Re: nohup doesn't accept aliases . .

[email protected] (Bob Proulx) Fri, 14 Jun 2002 01:30:51 -0600
Newsgroups gmane.comp.gnu.sh-utils.bugs
Message-ID <[email protected]>
> Hey, I was just trying to use nohup this way:
>  
> nohup cvsbackupthebackup 
>  
> where cvsbackupthebackup is just an alias - it looks like it does not
> correclty interpret the alias (it's an rsync command) -
>  
> I'd like to nohup and & my command so I can backup cvs, and logout and
> go home while it's working!

Unfortunately the shell only expands aliases when they are in the
command position.  The shell does not expand aliases when they are
passed as arguments to other commands.

Suggestion:  Instead of using an alias create a shell script.

File cvsbackupthebackup:

  #!/bin/sh
  rsync etc. etc. etc.

Make it executable.

  chmod a+x cvsbackupthebackup

Then since it is a real command and not an alias it does not need to
be expanded.  That will work as you want it to.

By the way...  Expanding aliases or not is not something that the
'nohup' command can do anything about.  It is a shell feature.

Bob