Hi,
Quote:
Would this work with HPUX to ?
|
On most (all?) HP boxes/OS's I've worked with sed is available/installed. It could be that you use an older version, but the basic functionality (which is used in the above example) is the same. So, yes it should work on HPUX.
Quote:
I tried what you suggested below on my file 0036
sed -e 's/^01483\(.*\)/01036\1/' 0036
or is the above wrong ?
|
Did you get any error messages?
the -e option isn't needed, but the command looks correct (scan all lines of the file, if a line starts with 01483 replace it with 01036 and do this for the file called 0036).
Quote:
Also - how do I specify the lines ?
|
Sed can work with ranges (or a single line):
sed '4s/X/Y/g' infile => changes all X's to Y's on line 4
sed '1000,2000s/A/B' infile => Change the first A in a line to B and do this for lines 1000 to 2000 (both are included)
Hope this clears things up.