[K12OSN] print based on location

Christopher K. Johnson ckjohnson at gwi.net
Tue Aug 31 01:15:08 UTC 2004


Tim Scholten wrote:

> thanks for the help, lpoptions works to set the printer at the command 
> line but not in the script. This is probably a scripting issue. I am a 
> newbie, so any help is appreciated
>
> this is the script i am trying to use:
>
> workstation='who -m|cut -d\( -f2|cut -d\) -f1'
> case $workstation in
> ws240.ltsp)
> 'lpoptions -d ws240';;
> ws238.ltsp)
> 'lpoptions -d ws240';;
> ws237.ltsp)
> 'lpoptions -d ws240';;
> ws236.ltsp)
> 'lpoptions -d ws240';;
> esac
>
> i know that the 'who -m|cut -d\( -f2|cut -d\) -f1' will give 
> "ws240.ltsp:0.0"
>
> thanks,
>
> Tim
>
Then you need to change that line to something like this:
workstation='who -m|cut -d\( -f2|cut -d\: -f1'
So it will give something of the form "ws240.ltsp" and match one of the 
cases following.
Currently the trailing ":0.0" is preventing matching any case.

Chris

-- 
-----------------------------------------------------------
   "Spend less!  Do more!  Go Open Source..." -- Dirigo.net
   Chris Johnson, RHCE #807000448202021





More information about the K12OSN mailing list