Matching opening and closing if statements in shell script (ifâ¦fi) using PHPStorm, vscode
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I hava bunch of these nested if..then...fi 's
if [ "$var" = "NA" ]
then
if [ "$var" != "SAM" -a "$fileFormat" != "XED" -a "$Format" != "TED" -a "$Format" != "ESTA" ]
then
echo "ERROR: Input file format not recognised"
echo "use --help for more information"
exit 1
fi
#convert esta to ted - start
if [ $fileFormat = "ESTA" ]
then
if [ $ENO != "NA" ]
then
ENO=$(greadlink -e $ENO )
fi
if [ -z "$output" ]
then
echo "WARNING"
echo "No output directory specified. Using current working directory, " $(pwd)/OUTPUT
output=$(pwd)/OUTPUT
fi
InputTed=$(greadlink -e $Inputted) #greadlink - to canonicanize/normalize to standard format
mkdir -p $output
cd $output
output=$(greadlink -e $(pwd) )
DIRECTORY=$(pwd)
In a more than 2000 line shell script. I would like to click on the opening if, and have the closing fi highlighted to easily navigate the code like it works with braces. I'm using PHPStorm, vscode but happy to try any free text editor that could do it out of the box or any plugin to these tools.
scripting osx plugin user-interface ide
add a comment |Â
up vote
0
down vote
favorite
I hava bunch of these nested if..then...fi 's
if [ "$var" = "NA" ]
then
if [ "$var" != "SAM" -a "$fileFormat" != "XED" -a "$Format" != "TED" -a "$Format" != "ESTA" ]
then
echo "ERROR: Input file format not recognised"
echo "use --help for more information"
exit 1
fi
#convert esta to ted - start
if [ $fileFormat = "ESTA" ]
then
if [ $ENO != "NA" ]
then
ENO=$(greadlink -e $ENO )
fi
if [ -z "$output" ]
then
echo "WARNING"
echo "No output directory specified. Using current working directory, " $(pwd)/OUTPUT
output=$(pwd)/OUTPUT
fi
InputTed=$(greadlink -e $Inputted) #greadlink - to canonicanize/normalize to standard format
mkdir -p $output
cd $output
output=$(greadlink -e $(pwd) )
DIRECTORY=$(pwd)
In a more than 2000 line shell script. I would like to click on the opening if, and have the closing fi highlighted to easily navigate the code like it works with braces. I'm using PHPStorm, vscode but happy to try any free text editor that could do it out of the box or any plugin to these tools.
scripting osx plugin user-interface ide
just to clarify the wording, those are sequentialif
s, not nestedif
s
â Jeff Schaller
Aug 17 at 13:21
1
Using indentation within your code would help tremendously.
â roaima
Aug 17 at 13:25
1
Related, with an answer that applies tovim
- Jump between theif
andfi
invim
, while editing abash
script?
â roaima
Aug 17 at 13:26
1
Further related, with instructions on makingmatchit.vim
work - Matchit not working
â roaima
Aug 17 at 13:43
I have revised the question to give a better illustration of the scenario. Thanks for the tip on matchit, I have tried it but seems to only work on the braces. Note, am using mac os, high siera.
â San Emmanuel James
Aug 17 at 20:15
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I hava bunch of these nested if..then...fi 's
if [ "$var" = "NA" ]
then
if [ "$var" != "SAM" -a "$fileFormat" != "XED" -a "$Format" != "TED" -a "$Format" != "ESTA" ]
then
echo "ERROR: Input file format not recognised"
echo "use --help for more information"
exit 1
fi
#convert esta to ted - start
if [ $fileFormat = "ESTA" ]
then
if [ $ENO != "NA" ]
then
ENO=$(greadlink -e $ENO )
fi
if [ -z "$output" ]
then
echo "WARNING"
echo "No output directory specified. Using current working directory, " $(pwd)/OUTPUT
output=$(pwd)/OUTPUT
fi
InputTed=$(greadlink -e $Inputted) #greadlink - to canonicanize/normalize to standard format
mkdir -p $output
cd $output
output=$(greadlink -e $(pwd) )
DIRECTORY=$(pwd)
In a more than 2000 line shell script. I would like to click on the opening if, and have the closing fi highlighted to easily navigate the code like it works with braces. I'm using PHPStorm, vscode but happy to try any free text editor that could do it out of the box or any plugin to these tools.
scripting osx plugin user-interface ide
I hava bunch of these nested if..then...fi 's
if [ "$var" = "NA" ]
then
if [ "$var" != "SAM" -a "$fileFormat" != "XED" -a "$Format" != "TED" -a "$Format" != "ESTA" ]
then
echo "ERROR: Input file format not recognised"
echo "use --help for more information"
exit 1
fi
#convert esta to ted - start
if [ $fileFormat = "ESTA" ]
then
if [ $ENO != "NA" ]
then
ENO=$(greadlink -e $ENO )
fi
if [ -z "$output" ]
then
echo "WARNING"
echo "No output directory specified. Using current working directory, " $(pwd)/OUTPUT
output=$(pwd)/OUTPUT
fi
InputTed=$(greadlink -e $Inputted) #greadlink - to canonicanize/normalize to standard format
mkdir -p $output
cd $output
output=$(greadlink -e $(pwd) )
DIRECTORY=$(pwd)
In a more than 2000 line shell script. I would like to click on the opening if, and have the closing fi highlighted to easily navigate the code like it works with braces. I'm using PHPStorm, vscode but happy to try any free text editor that could do it out of the box or any plugin to these tools.
scripting osx plugin user-interface ide
scripting osx plugin user-interface ide
edited Aug 18 at 0:06
roaima
40.4k547110
40.4k547110
asked Aug 17 at 13:10
San Emmanuel James
62
62
just to clarify the wording, those are sequentialif
s, not nestedif
s
â Jeff Schaller
Aug 17 at 13:21
1
Using indentation within your code would help tremendously.
â roaima
Aug 17 at 13:25
1
Related, with an answer that applies tovim
- Jump between theif
andfi
invim
, while editing abash
script?
â roaima
Aug 17 at 13:26
1
Further related, with instructions on makingmatchit.vim
work - Matchit not working
â roaima
Aug 17 at 13:43
I have revised the question to give a better illustration of the scenario. Thanks for the tip on matchit, I have tried it but seems to only work on the braces. Note, am using mac os, high siera.
â San Emmanuel James
Aug 17 at 20:15
add a comment |Â
just to clarify the wording, those are sequentialif
s, not nestedif
s
â Jeff Schaller
Aug 17 at 13:21
1
Using indentation within your code would help tremendously.
â roaima
Aug 17 at 13:25
1
Related, with an answer that applies tovim
- Jump between theif
andfi
invim
, while editing abash
script?
â roaima
Aug 17 at 13:26
1
Further related, with instructions on makingmatchit.vim
work - Matchit not working
â roaima
Aug 17 at 13:43
I have revised the question to give a better illustration of the scenario. Thanks for the tip on matchit, I have tried it but seems to only work on the braces. Note, am using mac os, high siera.
â San Emmanuel James
Aug 17 at 20:15
just to clarify the wording, those are sequential
if
s, not nested if
sâ Jeff Schaller
Aug 17 at 13:21
just to clarify the wording, those are sequential
if
s, not nested if
sâ Jeff Schaller
Aug 17 at 13:21
1
1
Using indentation within your code would help tremendously.
â roaima
Aug 17 at 13:25
Using indentation within your code would help tremendously.
â roaima
Aug 17 at 13:25
1
1
Related, with an answer that applies to
vim
- Jump between the if
and fi
in vim
, while editing a bash
script?â roaima
Aug 17 at 13:26
Related, with an answer that applies to
vim
- Jump between the if
and fi
in vim
, while editing a bash
script?â roaima
Aug 17 at 13:26
1
1
Further related, with instructions on making
matchit.vim
work - Matchit not workingâ roaima
Aug 17 at 13:43
Further related, with instructions on making
matchit.vim
work - Matchit not workingâ roaima
Aug 17 at 13:43
I have revised the question to give a better illustration of the scenario. Thanks for the tip on matchit, I have tried it but seems to only work on the braces. Note, am using mac os, high siera.
â San Emmanuel James
Aug 17 at 20:15
I have revised the question to give a better illustration of the scenario. Thanks for the tip on matchit, I have tried it but seems to only work on the braces. Note, am using mac os, high siera.
â San Emmanuel James
Aug 17 at 20:15
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f463182%2fmatching-opening-and-closing-if-statements-in-shell-script-if-fi-using-phpst%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
just to clarify the wording, those are sequential
if
s, not nestedif
sâ Jeff Schaller
Aug 17 at 13:21
1
Using indentation within your code would help tremendously.
â roaima
Aug 17 at 13:25
1
Related, with an answer that applies to
vim
- Jump between theif
andfi
invim
, while editing abash
script?â roaima
Aug 17 at 13:26
1
Further related, with instructions on making
matchit.vim
work - Matchit not workingâ roaima
Aug 17 at 13:43
I have revised the question to give a better illustration of the scenario. Thanks for the tip on matchit, I have tried it but seems to only work on the braces. Note, am using mac os, high siera.
â San Emmanuel James
Aug 17 at 20:15