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
|