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/../../..'
|