How to "sed" things?
hey all,,
lets say that i type the command "date"
i wanna sed two things alone!
the time alone and date alone!
for example.
if i type "Date"
and this is the result below
Thu Aug 14 13:07:26 IDT 2008
i want to sed the whole line to be sorted time alone in new line and date alone in another new line.
which means the new result should be like this:-
Thu Aug 14
13:07:26
now,, there is a second question with regrads to the "sed" command.
i got this command which shows my ip address
who am i | sed 's/[^(]*(\([^)]*\))/\1/'
the problem thats sed command shows also character between the numbers which means it does not show the ip ,, but it shows the whole hostname.
for example if i type the command
who am i | sed 's/[^(]*(\([^)]*\))/\1/'
the result will be
sde-84-109-50-43.red.sde.net
now i need the numbers only
which means the new result should be
84.109.50.43 (with dots)
thank you very much.
|