|
The UNIX command "sed", "awk", and "tr" offer a world
of solutions for altering text.
Using Ksh93 you can do substringing. You can find
it on Aix, and Sun system in the form of "dtksh". The syntax
is:
#!/usr/dt/bin/dtksh
...cut...
myvar=${myvarin:startpos:length}
...rest...
To edit a file on the fly use the old "edit"
command. An example follows:
3925:oratst@marge> cat
/tmp/abc
aaaaaaaaaaaabbbbbbbbbbbbbbbbbccccccccccccccc $HOSTNAME$.$SCHEMA$ 11111111111112222222222222222223333333333333 3925:oratst@marge> 3925:oratst@marge> edit /tmp/abc
<<\EOF
> 1,$s/\$HOSTNAME\$/MYBOX/g > 1,$s/\$SCHEMA\$/MYSCHEMA/g > w > q > EOF "/tmp/abc" 3 lines, 110 characters MYBOX.$SCHEMA$ MYBOX.MYSCHEMA "/tmp/abc" 3 lines, 105 characters 3925:oratst@marge> 3925:oratst@marge> 3925:oratst@marge> cat /tmp/abc aaaaaaaaaaaabbbbbbbbbbbbbbbbbccccccccccccccc MYBOX.MYSCHEMA 11111111111112222222222222222223333333333333 3925:oratst@marge> 3925:oratst@marge>
|
- Unix question Big Planet
- Re: Unix question Charlie Mengler
- RE: Unix question Mandar Ghosalkar
- Re: Unix question Big Planet
- RE: Unix question Chuck Hamilton
- RE: Unix question Brian MacLean
- RE: Unix question Brian MacLean
- Unix question Roland . Skoldblom
- Re: Unix question Patrik Malinen
- RE: Unix question John Dunn
- Re: Unix question Jay Hostetter
- Re: Unix question nlzanen1
- RE: Unix question Robertson Lee - lerobe
- RE: Unix question Rao, Maheswara
- Re: Unix question Joe Raube
- RE: Unix question Kimberly Smith
