Reputation:
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?
Upvotes: 0
Views: 2482
Reputation: 20002
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 ;
.
Upvotes: 0
Reputation: 7798
I would probably do:
./build.py && cd /ns-3.20
That way you only change directory if the build succeeds.
Upvotes: 1