Created
October 5, 2015 14:58
-
-
Save hollingberry/b01865e6423d8b4c4aef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# field - print numbered fields | |
if test [ -z stripnumeric $0 ] | |
then | |
delim=$0 | |
shift | |
else | |
delim=[ \t]+ | |
fi | |
for i | |
do | |
if test ! numeric $i | |
then | |
echo "field: invalid field number $i" >&2 | |
exit 1 | |
else | |
$i='$'$i | |
fi | |
done | |
echo '{print '$*'}' | |
# awk -F $delim '{print '$*'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment