Need help on sed command

April 12, 2009 at 22:53:29
Specs: Unix
Please explain what the following command will do
#get_asc | nawk -f SXMAT_SCRIPTS/DB.awk | sed 's/^[]*//g'

especially sed 's/^[]*//g'


See More: Need help on sed command

Report •


#1
April 13, 2009 at 06:56:52
Provided you uncomment the line,the output of program get_asc is piped to a nawk program. The nawk program to be execued is located in SXMAT_SCRIPTS/DB.awk. The output of this program is piped to the sed script.

The sed script, I think, is trying to delete the leading spaces from each line. It fails on my solaris 9 without a space between the braces:

sed 's/^[ ]*//'



Report •

#2
April 15, 2009 at 01:30:10
Thanks

Report •

#3
April 15, 2009 at 10:51:45
i think the below command
sed 's/^[ ]*//'
delete the empty space from the file



Report •

Related Solutions

#4
April 15, 2009 at 12:29:11
psiva_unix:

I must respectfully disagree with you. This command:

sed 's/^[ ]*//'

deletes the "leading" spaces from each line - not every space.


Report •

#5
April 20, 2009 at 17:25:21
Dear nails
"leading" spaces from each line means spaces at the begining of each line?

Report •

#6
April 21, 2009 at 06:15:02
Yes, leading spaces are spaces at the beginning of each line.


Report •

#7
April 21, 2009 at 22:09:07
Thanks

Report •


Ask Question