Afficher un message
Vieux 30/05/2007, 08h01   #4
mowgli
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: shell script question - changing PS1 based on tty


Chris F.A. Johnson wrote:

> Don't call tty every time; store the result in variable and compare that.


Thanks for the suggestion

> I'd shorten the script to:
>
> if [ "$UID" -eq 0 ]

[snip]

I now used `id -u` to get the userid number directly

> num=$(( ${tty#/dev/tty} + 1 ))


Can you please explain this one ? I do not understand the # and {}
thing


Regards,
mowgli

  Réponse avec citation
 
Page generated in 0,04363 seconds with 9 queries