Code for running commands one after other

I need an if code in shell script where it should continue to further commands after succesfully installing the executable file.

i.e. /run installer is continuing but in the middle it executes further commands like "cp /root/user which were given after /run installer.

I want /runinstaller to complete its process and after its done it should go further commands

---------- Post updated at 03:16 PM ---------- Previous update was at 02:32 PM ----------

Can anyone help me asap

---------- Post updated at 03:16 PM ---------- Previous update was at 03:16 PM ----------

Can anyone help me asap

Can you elaborate with the exact sequence of commands. Could not deduce from above explanation.

a) cd /root/user/dir/sd/disk
./runInstaller -silent -responseFile

b) cd /root1/user1
cp /root/user/dir/sd/disk/ram.txt
now b) executes before a) is successfully done.

so I want b) to start only after successfull completion of a)

What about:

/run installer && cp /root/user && next command && last command

I am doing this in a script...there are like 100 commands after that installation file...and 100 commands are dependant on the installation directory

---------- Post updated at 05:08 PM ---------- Previous update was at 03:46 PM ----------

I need code which lets the following commands to run only after the present command is completely done successfully as described above.

command || exit 1
command2 || exit 1
command3 || exit 1

...and so it goes.

what do u mean by exit 1 ....how does it work. can u brief it out

"exit 1" tells it to exit with a failing error code.

The || tells it to run the command after it only if the previous command failed.

So, /bin/true || echo asdf would never print anything, but /bin/false || echo asdf would always print. And command || exit would exit only if 'command' failed.

It doesnt work... Can anyone one help me better

What doesn't work. Be more specific.

export TMOUT=0 or unset TMOUT

It says TMOUT is read only

I think you posted in the wrong thread.

Let me make it clear. Iam running installer.It should return exit staus that installation is done succeesfully and then we can run the further commands.

---------- Post updated 09-23-10 at 09:40 AM ---------- Previous update was 09-22-10 at 08:44 PM ----------

Can any1 help me with the issue

So, what is the question? What is the problem? Why doesn't my solution work?

a) cd /root/user/dir/sd/disk
./runInstaller -silent -responseFile

b) cd /root1/user1
echo "copying"
cp /root/user/dir/sd/disk/ram.txt
now b) executes before a) is successfully done.

so I want b) to start only after successfull completion of a)

when a) has started execution

/...it goes on running like
instaling
memory check passed.
dir check passed
copying ( this is from echo)
locating directory(this is from run installer)
installed succesffully

Now in above you c that while installer is running copying is also done
but I want it the following way

when a) has started execution

/...it goes on running like
instaling
memory check passed.
dir check passed
locating directory(this is from run installer)
installed succesfully

now it should start copying
copying ( this is from echo)

Most likely B finishes before A is down because it set to run in the background. Some silent options will trigger this event. Try running the same setup without the -silent option.

I need to do a silent install......Can any one find a solution for this situation