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 &".
I wonder what that &
(ampersand) means there.
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 &".
I wonder what that &
(ampersand) means there.
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.The ampersand (
&
) means that you want to runmyprogram
in background. This is normally used when you want to stay on your command-prompt and continue the work on the same session.Example
will run the
somescript
shell script in background. You will get the prompt back on the next line. If you runsomescript
without&
then the prompt may not appear back becausesomescript
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
the jobs command will display the jobs running in background.