I need to develop a client and server program with using sockets. My program should get port number from the command line. I saw an example which says \"myprogram 2454 &\".<
The ampersand (&
) means that you want to run myprogram
in background. This is normally used when you want to stay on your command-prompt and continue the work on the same session.
Example
somescript &
will run the somescript
shell script in background. You will get the prompt back on the next line. If you run somescript
without &
then the prompt may not appear back because somescript
may take more time.
The best way is to run it in background with no hangups, in which case even of you loose your connection to the host the process keeps running on the UNIX or Linux host.
For example
nohup somescript &
the jobs command will display the jobs running in background.
It means to start the process in the background. http://tldp.org/LDP/abs/html/x9644.html so that you may continue to use your shell session to run other programs. You can then use fg
to "foreground" your process again.