![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Odd .sh behavior in script | robertmcol | UNIX for Dummies Questions & Answers | 2 | 02-10-2008 10:22 AM |
| ltoa Behavior | charitonca | HP-UX | 2 | 07-13-2006 06:29 PM |
| ls behavior | AtleRamsli | High Level Programming | 10 | 03-26-2002 07:31 AM |
| Telnet behavior | piltrafa | UNIX for Dummies Questions & Answers | 4 | 10-31-2001 03:49 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
sed behavior on hp-ux
the sed command:
sed 's/^[ \t]*//' file does not work on HP-UX :-( but it works fine on Linux, content of file: <tab><tab>hello output should be: hello Any ideas?? Thank you Andy Last edited by andy2000; 05-04-2007 at 02:19 PM.. |
|
||||
|
I ran it on HPUX 11.0 and 11.23 works just fine. There must be something else other than your sed command going on. The sed string you have removes ONE tab not all of them. Is that what you mean by 'does not work' ?
Code:
sed 's/^[ \t]*//g' |
|
||||
|
Code:
sed 's/^[ ]*//' file Code:
kcsdev:/home/jmcnama> echo " hello" | sed 's/^[ ]*//' hello Code:
kcsdev:/home/jmcnama> sed 's/^[ ]*//' < file
hello
kcsdev:/home/jmcnama> cat file | sed 's/^[ ]*//'
hello
This works on a file: Code:
while read record
do
echo $record | sed 's/^[ ]*//
done < file > newfile
|
![]() |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|