Discussion: can this be done(sed)
Afficher un message
Vieux 22/08/2006, 07h04   #5
JyotiC
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: can this be done(sed)

thanx to all for the
Rakesh Sharma wrote:
> 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,05433 seconds with 9 queries