Wednesday, September 17, 2008

ELIMINATING MULTIPLE SPACES

Here is a simple script whichhelps in eliminating multiplespaces when one wants toextract a particular columnin a set of records from afile.

Here is an example to provethe same:

ps -u $LOGNAME tr -s " " : cut -d: -f

The above script line can beused to extract a column fromthe output of a ps command for a particular user ($LOGNAME).

No comments: