Friday, August 5, 2011

Cut First Character From Line

Cut First Character From Line
=======================

cat 12 |sed 's/.\(.*\)/\1/' ( 12 is the file name)


Removing the last three characters from every filename.

==============
$ cat files
apache-1.3.39.exe
==============
$ cat files | sed 's/\(.*\).../\1/'
apache-1.3.39
==============

Removing last character from each filename/strin.

==============
$ cat files |sed 's/\(.*\)./\1/'
apache-1.3.39.ex

==============

No comments:

Post a Comment