0

I am looking into the nohup command and I am not sure which shells it support. It seems as if this program works differently in bash and tcsh. What I tried was something very simple.

nohup --help

When I start it from bash it works just fine, but for tcsh is says,

--help: Command not found.

This does definitely not mean the command not works, but this is a confusing indicator. Due to that the settings on the machine I run on seems to keep programs a fairly long time before they terminate, it is hard to actually verify that nohup is working.

Another indicator that things no works as expected is that when running the script I plan to run it does also work differently. When running in bash it will output to nohup.out, while in tcsh it does not (it outputs to the terminal I run the nohup command in).

Any ideas?

Tested on both rhel6 and rhel7

2

When in bash, using nohup will use the external utility nohup. The GNU coreutils' version of nohup does indeed have a --help flag that will output some information.

When in tcsh, using nohup will use the shell's built-in command nohup, even in an external utility of the same name exists. See the tcsh manual for more information about the built-in nohup in that shell.

To use GNU coreutils' nohup in tcsh, use the utility with its full path, e.g., /usr/bin/nohup --help.

  • Thank you for the answer I just found the nohup built-in command in the tcsh man page. Seems I missed on the overloading. Unfortunately the man page does not lead to the built-in command :( – patrik May 2 '18 at 10:36
  • @patrik No, built-in utilities doesn't usually have their own manuals but are usually documented in the shell's own manual (except for in zsh where the builtins have their own dedicated text in the separate zshbuiltins manual). – Kusalananda May 2 '18 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.