hi i'm new to unix and can someone tell me what is doing this
g/^{/.-1p
line in the ed editor in unix? I wrote it in ed but nothing happend!10x
Printable View
hi i'm new to unix and can someone tell me what is doing this
g/^{/.-1p
line in the ed editor in unix? I wrote it in ed but nothing happend!10x
All newbies must learn man, man man for more info ;)
I don't get the last p bit?!?
g/<something>/ means print lines that contain <something>. ^ is the start of a line. { is just the karakter {. So g/^{/ means print all lines that begin with {.
A . (dot) means current addres or line and -1 well.. ehm
so if test.txt contains:
Code:something
test
{ here
there {
Code:>ed test.txt
30
g/^{/
{ here
g/^{/.-1
test
g/^{/.+1
there {
10x man :} -1 and p i know what they mean,about man u r absolutely right