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?
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 ;.
cd /ns-3.20 work, or should this be changed into cd $HOME/ns-e.20 ? Does ./build.py execute ? Try echo "Test"; pwd;cd /tmp'pwd; cd;pwd
;to sequence commands./build.py; cd /ns-3.20. the|is for chaining commands (unnamed pipe).