Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I am trying to create a bash alias, however the graveyard ticks are being evaluated as a literal when I define the alias. I've tried escaping these with a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2012
    Posts
    3

    Question about bash aliasing evaluating as a literal


    Hi, I am trying to create a bash alias, however the graveyard ticks are being evaluated as a literal when I define the alias. I've tried escaping these with a \ however it did not work. Could somebody possibly tell me if it is possible to do the following command in a bash alias? I realize I could probably use a function, or a shell script referenced by the alias, but I would like to do it in the alias itself if possible:

    # alias rdpkill="for i in `ps -ef | grep rdesktop | grep -v grep | awk '{ print $2 }'`; do kill $i; done"
    # alias | grep rdpkill
    alias rdpkill='for i in ; do kill 28601; done'

  2. #2
    Just Joined!
    Join Date
    Jan 2009
    Posts
    11
    This should work...


    alias rdpkill=$(for i in `ps -ef | grep rdesktop | grep -v grep | awk '{ print $2 }'`; do kill $i; done)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •