Using aliases with nohup

后端 未结 4 1584

Why doesn\'t the following work?

$ alias sayHello=\'/bin/echo \"Hello world!\"\'
$ sayHello 
    Hello world!
$ nohup sayHello
    nohup: appending output to `n         


        
4条回答
  •  我寻月下人不归
    2021-02-19 12:17

    If you look at the Aliases section of the Bash manual, it says

    The first word of each simple command, if unquoted, is checked to see if it has an alias.

    Unfortunately, it doesn't seem like bash has anything like zsh's global aliases, which are expanded in any position.

提交回复
热议问题