tags:

views:

28

answers:

2

Hi I am figuring out the Ipython shell support. Its seems awk doesn't work i.e following command

!ls -l | awk '{print $1}' 

just prints "1".

How do I pass the "$" sign correctly to shell. I am using zsh.

Thanks
Sandeep

A: 

Try escaping $ as \$

!ls -l | awk '{print \$1}' 
codaddict
That was also my first try. But results in error with following message:awk: {print \1}awk: ^ backslash not last character on line
Sandeep
+1  A: 

Two dollar signs give you a literal dollar sign, so try:

!ls -l | awk '{print $$1}'
schot
This works. Thanks.
Sandeep