Thank you for your help guys ! :-)
pixellany, I have read in SED tutorial that there are 3 different ways to print specific line from text file and chose
sed "/$i/!d"
I put in my script sed -n "/$1/p" as you advised.
There is something very interesting I have noticed, when I have
Code:
sed -n "/1/p" users
inside the script it shows me the user name located on the first line, but if I do
Code:
sed -n "/3/p" users
It does not show me anything (no error message). On the other hand if I do
from shell it gives me the user name on line 3 :-) Funny....
The file with users looks like :
Code:
[myuser@theserver webusers]$ cat users
user1
user2
user3
user4
...
...
...
user35
I feel that there is something small and silly I am missing .... do not know !
Sed tutorial is very valuable, thanks again ;-)