I need to execute two commands in the same line from the terminal. But it executed only the first command.
./build.py || cd /ns-3.20
That command only build was working and doesn't navigate to next directory.
Where am I get wrong?
I need to execute two commands in the same line from the terminal. But it executed only the first command.
./build.py || cd /ns-3.20
That command only build was working and doesn't navigate to next directory.
Where am I get wrong?
Change |
to ;
:
./build.py; cd /ns-3.20
I would probably do:
./build.py && cd /ns-3.20
That way you only change directory if the build succeeds.
you can use & :
./build.py & cd /ns-3.20
With ./build.py || cd /ns-3.20
you only go to /ns-3.20 when the first command fails.
Is /ns-3.20
a directory you can access and has some files you need for repairing the build?
When you want to go to that directory only after success, use &&
. When you want there independant of the result, use ;
.