Basically, there's one script, installed at /usr/bin/1 and all of the rest are symbolic links back to this one.
The net effect of each of these is to print the Nth column of whatever comes in on standard input. In this way, "1" is sort of an alias for:
awk '{print $1}'
Each of these accept a single option argument. By default, whitespace is assumed to be the input field separator. You can specify a different character or string here.
For example:
ls -alF | 5
cat /etc/passwd | 7 :
If you find this useful, install the bikeshed package from Natty, or from the Bikeshed PPA for other versions of Ubuntu.
Cheers,
:-Dustin
if you put this:
ReplyDelete--------------------------
eval "awk '{print $"$0"}'"
---------------------------
into a file like test.sh
and then use:
ln -s test.sh 1
ln -s test.sh 2
ln -s test.sh 3
ln -s test.sh 4
it will to that.