On Thu, 25 Apr 2002, Speeddymon wrote:
- if [ -d "/usr/lib/menu" -a "$mode" = "menu" -a ! `whoami` = "root" ]
- then
[...]
- elif [ `whoami` = "root" ]
- then
- mdk_entry >> "/usr/lib/menu/wine"
- fi
Sorry, I haven't been following this but isn't the elif condition redundant?
Also, AFAIK although its unusual, there's no reason an account name cannot have a space in it, so `whoami` should be "`whoami`"
[spent too much time debugging strings in scripts ;^]
---- Paul Millar
Paul Millar a écrit :
On Thu, 25 Apr 2002, Speeddymon wrote:
- if [ -d "/usr/lib/menu" -a "$mode" = "menu" -a ! `whoami` = "root" ]
- then
[...]
- elif [ `whoami` = "root" ]
- then
- mdk_entry >> "/usr/lib/menu/wine"
- fi
Sorry, I haven't been following this but isn't the elif condition redundant?
Also, AFAIK although its unusual, there's no reason an account name cannot have a space in it, so `whoami` should be "`whoami`"
[spent too much time debugging strings in scripts ;^]
Paul Millar
Shouldn't we check for uid == 0? The common name for that uid is "root", but I don't think anything prevents you from changing that name to say... administrator, or god. But that check is easier to do with a C program than shell...
And besides, as I read in another thread about Mingw, shouldn't we test for a functionality (being able to write somewhere, to use a certain program) rather than rely on the username and implied permissions of it?
But maybe I'm just way off track here...
Cheers, Vincent
On Thu, Apr 25, 2002 at 05:21:17PM -0400, Vincent Béron wrote:
Paul Millar a écrit :
On Thu, 25 Apr 2002, Speeddymon wrote:
- if [ -d "/usr/lib/menu" -a "$mode" = "menu" -a ! `whoami` = "root" ]
- then
[...]
- elif [ `whoami` = "root" ]
- then
- mdk_entry >> "/usr/lib/menu/wine"
- fi
Sorry, I haven't been following this but isn't the elif condition redundant?
Also, AFAIK although its unusual, there's no reason an account name cannot have a space in it, so `whoami` should be "`whoami`"
[spent too much time debugging strings in scripts ;^]
Shouldn't we check for uid == 0? The common name for that uid is "root", but I don't think anything prevents you from changing that name to say... administrator, or god. But that check is easier to do with a C program than shell...
id -u
Steve Langasek postmodern programmer
--- Paul Millar paulm@astro.gla.ac.uk wrote:
On Thu, 25 Apr 2002, Speeddymon wrote:
- if [ -d "/usr/lib/menu" -a "$mode" = "menu" -a
! `whoami` = "root" ]
- then
[...]
- elif [ `whoami` = "root" ]
- then
- mdk_entry >> "/usr/lib/menu/wine"
- fi
Sorry, I haven't been following this but isn't the elif condition redundant?
not really, because what it says is:
if /usr/lib/menu is a directory and $mode is menu and i am NOT root then su to root and run this command else if i AM root then just run this command
if that elif were an else then the command would be run for example if /usr/lib/menu isn't a directory or if the mode isnt menu
Also, AFAIK although its unusual, there's no reason an account name cannot have a space in it, so `whoami` should be "`whoami`"
only reason it is `whoami` instead of "`whoami`" is because i copied it from the wineinstall script, so just for the sake of argument and not having to have someone change it in all of the scripts, i left it like that...
[spent too much time debugging strings in scripts ;^]
same here, thats why im contributing...
__________________________________________________ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/