2

How to start sh file in one line command ? This is how I normally start sh file in the specific path

user@user:~$ cd idea-IC-171.4424.56/bin
user@user:~/idea-IC-171.4424.56/bin$ ./idea.sh 

If I would like to start the command in one line like below, I will get error

user@user:~/idea-IC-171.4424.56/bin$ cd idea-IC-171.4424.56/bin/idea.sh
bash: cd: idea-IC-171.4424.56/bin/idea.sh: No such file or directory
2

1 Answer 1

3

Use a ";" to seperate your commands

cd idea-IC-171.4424.56/bin ; ./idea.sh

You could use ./idea-IC-171.4424.56/bin/idea.sh to run it, however the results may be different as if the [shell] script accesses files in the current or relative directory, it won't find them as you didn't cd there before run.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.