|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
BASH Script, read a line from a file
Hi, I'm trying to write a BASH script that uses a file containing a list of user names:
cg776 jcq448 dfs etc... I want to read each line into a string, then run: Code:
finger | grep FRIEND or something to that affect, then I need to determine if the user supports real time chat (the '*' somewhere in the line of output from finger for that user I think...) If anyone could lend a hand it would be appreciated... |
|
#2
|
||||
|
||||
|
I have a file called names, which looks like:
chris cristi spira erik I have a script called namelooper.sh which looks like: Code:
#!/bin/bash
NAMES=`cat names`
for i in $NAMES
do
RESULT=`finger $i`
echo $RESULT
done
when I chmod 777 namelooper.sh and then run it, I get the following output - tidy it up as you like: Quote:
hth christo
__________________
. Spiration channels: Free scripts, programming tutorials and articles Dotcut alerts: Online Press cuttings / news alerts Clearprop: UK microlight school, wiltshire Uk dating: UK safe dating with Topdates About Christo . . Last edited by christo : October 30th, 2006 at 08:25 AM. |
|
#3
|
|||
|
|||
|
how do i get to see the lines i read and search them for a particular char - I need to read and ignore a file till i find a certain string and then write out the rest of the file in to another file using sh ... can some one help ? thanks
![]() i tried using cat and a for loop but that breaks up the lines into words ... and the echo -n option does not work with my sh ... so it puts the words in seperate lines . |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > BASH Script, read a line from a file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|