Results 1 to 3 of 3
I need some help with sed because im not so used to it.
I want to insert a line into passwd and the input comes from a variable or shell ...
- 06-24-2009 #1Just Joined!
- Join Date
- Jun 2009
- Posts
- 4
execute shell command within sed
I need some help with sed because im not so used to it.
I want to insert a line into passwd and the input comes from a variable or shell command.
the sed string is or should be:
sed '/\+\:\:\:\:\:\:/ i\echo ${login}::${uid}:${gid}:${fullname}:${homedir}:$sh ell' $pwfile
so my question is, how can i execute shell commands within the sed string/after the i\ ?
would be great if anyone could help me or give me a hint.
regards space
- 06-24-2009 #2
you can use an environmental varibale inside sed like
google with term "sed environment variable substitution"sed s/one/`$PWD`/g sed.txt
sed environment variable substitution - Google Search
HTH- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 06-24-2009 #3Just Joined!
- Join Date
- Jun 2009
- Posts
- 4
thx, it's working


Reply With Quote