[K12OSN] Need script help for fl_teachertool

Eric Harrison eharrison at mail.mesd.k12.or.us
Wed May 3 01:47:21 UTC 2006


On Tue, 2 May 2006, Robert Arkiletian wrote:

> I can find the ip of a client I am sitting at with
>
> cat /etc/hosts | grep `echo $DISPLAY | cut -d: -f1` | cut -f1
>
> problem is if I run this command from the server I get
>
> Usage: grep [OPTION]... PATTERN [FILE]...
> Try `grep --help' for more information.
>
> What I want is 192.168.0.254
>
> Any ideas?

You are probably testing this while logged directly into the server,
as opposed to from a terminal. From the console, the DISPLAY will be ":0.0"
If you run that through "cut -d: -f1", you'll get an empty line "" which
will cause grep to return the help message you see.

Try running the commands one by one:

 	echo $DISPLAY
 	echo $DISPLAY | cut -d: -f1

-Eric




More information about the K12OSN mailing list