Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
test users from a file
Name: Hamim Date: November 3, 2003 at 06:03:49 Pacific OS: Sco Openserver CPU/Ram: pentium 2
Comment:
Hi I want to know how to do a test for users eg: a file called pals & in it I have a list of users. I want to : while test $1 do if test $1 != "pals" then do something fi
Name: Frank Date: November 4, 2003 at 02:03:24 Pacific
Reply:
Not sure if I understood you correctly,
ok first you have a file called pals e.g. frank david lucas
and you would like to read the content of the file
{ while read user do if [ $user != frank ] then echo "Du bist nicht Frank aber $user" else echo "Du bist Frank" fi done } < pals
hope I got your question right.
No Risk no fun Frank
0
Response Number 2
Name: Hamim Date: November 4, 2003 at 06:39:17 Pacific
Reply:
Currently i am using this scirpt: set `who -u` while test $1 do if test $1 != "root" then tm=$6 procid=$7 case $tm in .) ;; 0:*) ;; 1:*) ;; *) kill -9 $procid esac fi shift;shift;shift;shift;shift;shift;shift done
I need to have more than root excluded from being killed -thats why I want to have a file called "pals" to include users not to be killed
Thanks Hamim
0
Response Number 3
Name: nails Date: November 4, 2003 at 12:55:49 Pacific
Reply:
Hamim:
You have a logic problem. You can't do this:
set `who -u`
but you can do this:
`who -u` > data.file
Then read data file with your loop
while read line do set $line . . done < data.file # end stub
Summary: Hello all, I hav a c program which does a scanf. its like this :- int main() { int i; scanf("%d",i); return 0; } Is it possible 4 the program to take input from a file & not wait 4 the user in...
Summary: I need help in trying to extract information from a file (test.file). This file contains other files, basically a catalog of files. I would like to be able to move or extract each file from (test.fi...