From the command line I can execute the following with success:
It prints the first column of a ps listing as expected. However, if I bind this command to an alias, it does not handle the "$1" variable correctly. I've tried escaping the variable with a backslash, single quote, and double quote, but that did not solve the problem. How can I set the alias correctly?
I'm using tcsh, but I'm not sure if it matters.
Code:
ps | awk '{print $1}'
It prints the first column of a ps listing as expected. However, if I bind this command to an alias, it does not handle the "$1" variable correctly. I've tried escaping the variable with a backslash, single quote, and double quote, but that did not solve the problem. How can I set the alias correctly?
I'm using tcsh, but I'm not sure if it matters.
Code:
>alias test "ps | awk '{print $1}'"
>alias test
ps | awk '{print }'