set autoexpand set autolistin the .tcshrc
sed -e "s/foo/bar/g" MyFilewill replace all instances of foo with bar in MyFile
grep -l int *.c | sed -e "/^Example/d" -e "s/\.c//"will grep for the names of all .c files containing int (we could do better there :-), delete lines that start with Example, and remove the .c from the remaining names.
sed -f MySedScript MyFilewill apply the commands in MySedScript to MyFile. Here's an example for MySedScript
1,5d /^#/d /^START/,/END$/s/ */ /g s/ *$//Those commands will delete lines 1 to 5, delete lines that start with a #, in the lines from the first that starts with START to the first that ends with END replace sequences of spaces with a single space, then on all lines delete all trailing spaces.
int aDog;
int aDog ;
// int aCommentAboutADog;
double aBigDog;
int BadDog;
int dogWithNoTail
int aDog,aCat;
int aSpaceDog, aSpaceCat;
int aDog aBadCat;
internationalDog;
int a#Dog;
int internetName; // fooo
!17 !gli
ls & ps & date & ls ; ps ; date
find / -empty | wc -w
bbbbcc abbccc aaabbbccc aaabbbcccddd bccbccbccbccbcc