sslug-teknik team mailing list archive
-
sslug-teknik team
-
Mailing list archive
-
Message #90689
Re: Fejl i script, find den...
Fredag 12 januar 2007 11:29 skrev Peter Makholm:
> Verner Kjærsgaard <vk@xxxxxxxxxxxxx> writes:
> > dell102:/home/vk/Pgms/scripts # cat kill-a-user.sh
>
> [...]
>
> > dell102:/home/vk/Pgms/scripts # ./kill-a-user.sh egon
> > ./kill-a-user.sh: line 6: : command not found
> > ./kill-a-user.sh: line 7: : command not found
> > ./kill-a-user.sh: line 8: : command not found
> > ./kill-a-user.sh: line 9: : command not found
> > dell102:/home/vk/Pgms/scripts #
>
> iPrøv lige med 'cat -A' istedet for 'cat'. Så kan vi se om der er
> nogle sjove tegn i starten af linjen.
>
> //Makholm
BINGO!
Se her...:
vk@dell102:~/Pgms/scripts> cat -A kill-a-user.sh
#!/bin/sh$
# script to logoff a student$
#$
if [ $1 != "root" ]$
then$
M-BM- M-BM- for i in $(pgrep -u $1)$
M-BM- M-BM- do$
M-BM- M-BM- M-BM- M-BM- kill -9 $i$
M-BM- M-BM- done$
else$
M-BM- M-BM- clear$
M-BM- M-BM- echo "Can't kill the root!!"$
--
-------------------------------------------------------------------------
Med venlig hilsen/Best regards
Verner Kjærsgaard
+===============================================================+
Powered by openSUSE 10.2 (i586) Kernel: 2.6.18.2-34-default
KDE: 3.5.5 "release 45"
11:40am oppe 2:49, 3 users, belastningennemsnit: 0,37, 0,23, 0,13
+===============================================================+
Follow ups
References