Discussion: can this be done(sed)
Afficher un message
Vieux 21/08/2006, 11h24   #2
Rakesh Sharma
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: can this be done(sed)


JyotiC wrote:
> hi
> when writing a sed command as
> sed 's/../../..' filename
> it takes input as some file,
> can a string be given as input as
> sed 's/../../..' string
>


sed -e 's/.../.../..' << [EOF]
string
[EOF]

provided the string doesnot contain [EOF] in it. but you can override
this
by storing the string in a variable.

or we can pipe it:

var='string'
printf '%s\n' "$var" | sed -e 's/../../..'

  Réponse avec citation
 
Page generated in 0,05205 seconds with 9 queries