[98625] in RedHat Linux List

home help back first fref pref prev next nref lref last post

RE: A script problem

daemon@ATHENA.MIT.EDU (Charles Galpin)
Mon Nov 9 21:16:10 1998

Date: Mon, 9 Nov 1998 21:03:51 -0500
From: Charles Galpin <cgalpin@lighthouse-software.com>
To: Jan Carlson <redhat-list@redhat.com>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com

Sorry, I fumbled and somehow sent that last message before finishing.

Zoki,

I'm sure you understand know, but just for everyone's sake, I want to point 
out that what you did worked because as Tony said, $USER already contained 
the user name.

>'/usr/bin/id -un'=USER

This line did absolutely nothing

>if  [ "$USER" = "zokiphoto" ]; then

but $USER saved the day.

'/usr/bin/id -un'=$USER would have assigned the poorly named variable 
'/usr/bin/id -un' the current user, and perhaps something like

 if  [ ${'/usr/bin/id -un'} = "zokiphoto" ]; then

might have worked

charles

>> >#!/bin/sh
>> >
>> >'/usr/bin/id -un'=USER
>>
>> Shoudn't this line read:
>>
>>         USER='/usr/bin/id -un'
>
>No, because USER already has this value.
>Bash maintains it for you.

-- Charles Galpin   <cgalpin@lighthouse-software.com>


-- 
  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.


home help back first fref pref prev next nref lref last post