- Published:
- February 23, 2010 – 5:41 pm
- Author:
- By Dave
My professor sent us this little one liner (ok, I had to format it to 2 lines to fit in this blog. You know what I mean) which prints out the current directory tree:
ls -R | grep “:$” | sed -e ’s/:$//’ -e ’s/[^-][^\/]*\//–/g’ \
-e ’s/^/ /’ -e ’s/-/|/’
What’s going on here?
Categories: Code Samples, Shell
Tagged: bash, sed
- Published:
- October 14, 2008 – 3:16 pm
- Author:
- By Dave
Found a great post over at good coders code, great reuse. This one deals with performing operations on sets using only unix (bash) command line operations on files of text.
* Set Membership. Test if an element belongs to a set.
* Set Equality. Test if two sets [...]
Categories: Code Samples, Linux, Shell
Tagged: awk, bash, grep, join, sed, set operations, union