Results 1 to 2 of 2
Hi, guys. I have one question.
Assumed I have have a variable $userlist, it has the following contents:
brownj
smithk
smithk2
smithk3
hynesp
hynesp2
leeb
...
How can I write ...
- 03-18-2009 #1Just Joined!
- Join Date
- Mar 2009
- Posts
- 4
How can I extract certain strings from a variable?
Hi, guys. I have one question.
Assumed I have have a variable $userlist, it has the following contents:
brownj
smithk
smithk2
smithk3
hynesp
hynesp2
leeb
...
How can I write a bash script that extracts all the strings smithk, smithk2, smithk3, etc from variable $userlist, and assigns these strings to a new variable?
Thanks a lot in advance
-K.D
- 03-19-2009 #2Linux Newbie
- Join Date
- Feb 2009
- Posts
- 99
$new=$(cat path_to_file)


Reply With Quote