A Scripter's Notes

Emacs, scripting and anything text oriented.

Using sed

sed stands for stream editor.

This is the most common way of my sed usage:

echo [SOMETHING] | sed 's/old/NEW/g'

Based on that, I have this tcsh alias1 to get timestamps that I use to append to quick tar backups.

alias gettimestamp 'date | tr " :" "__" | sed '"'"'s/_[0-9]*_EDT.*//g'"'"''

Learn about sed from here.


  1. Note how single quotes are escaped inside single-quoted alias definitions in tcsh. [return]

Comments

comments powered by Disqus