[98656] in RedHat Linux List
Re: A script problem
daemon@ATHENA.MIT.EDU (David S. Jackson)
Mon Nov 9 23:39:24 1998
Date: Mon, 9 Nov 1998 23:34:41 +0000
From: "David S. Jackson" <dsj@dsj.net>
To: redhat-list@redhat.com
Reply-To: "David S. Jackson" <dsj@dsj.net>
In-Reply-To: <3.0.5.32.19981109231945.00811100@fmol.5sigcmd.army.mil>; from Anthony E. Greene on Mon, Nov 09, 1998 at 11:19:45PM +0100
Resent-From: redhat-list@redhat.com
Thus spake Anthony E. Greene (agreene@pobox.com):
> At 17:05 1998-11-09 +0100, Zoki wrote:
> >*** I couldn't sit still so I went on messing around with the script. At
> >this point it works, but I still would like to get feedback if it's done
> >according to the rules. This is the solution I found:
> >
> >********* The script *********************
> >
> >#!/bin/sh
> >
> >'/usr/bin/id -un'=USER
>
> Shoudn't this line read:
>
> USER='/usr/bin/id -un'
I think this is usually already set in /etc/profile on a RH system,
right? Way I read it was $USERID was a non-standard variable to play
around with for learning purposes, even though it's redundant if $USER
is already set.
What I think is funny is that no one seems to have answered why the
if [ '/usr/bin/id -un' = "zokiphoto" ];
comparison doesn't work. I would answer that Zoki's problem was a
command-line processing error. He should study page 174 thru 182 of
the BASH book from O'Reilly, I think. In the meantime, Zoki could
take any of the previous suggestions, or he could substitute
$(/usr/bin/id -un) or $(eval '/usr/bin/id -un') for the first part of
the comparison.
--
David S. Jackson http://www.dsj.net
=======BEGIN GEEK CODE BLOCK======
Version: 3.12
GTW/GL d- s+:+ a43 C+++ USL++++ P+>+++ L+++ E++ W++ N++@ o--
K- w--- O++@ M V PS+ PE++ Y+>++ PGP++(+++) t+ 5 X+ R-@ tv b++
DI+++ D++ G++ e++ h---- r+++ y++++
=======END GEEK CODE BLOCK========
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com http://archive.redhat.com
To unsubscribe: mail redhat-list-request@redhat.com with
"unsubscribe" as the Subject.