View previous topic :: View next topic |
Author |
Message |
Kronos Tux's lil' helper
Joined: 05 Sep 2002 Posts: 116 Location: St. Louis area (Wood River, IL)
|
Posted: Wed Oct 09, 2002 1:34 am Post subject: /bin/sh ?! |
|
|
finger kronos
Login: kronos Name: (null)
Directory: /home/kronos Shell: /bin/sh
On since Tue Oct 8 17:57 (UTC) on vc/1 2 hours 37 minutes idle
(messages off)
Last login Tue Oct 8 20:03 (UTC) on 2
No mail.
No Plan.
finger root
Login: root Name: root
Directory: /root Shell: /bin/bash
Last login Tue Oct 8 17:57 (UTC) on 2
No mail.
No Plan.
Didn't know my user kronos was by default using /bin/sh as a shell. How do I set it to /bin/bash?
Kronos |
|
Back to top |
|
|
Curious Bodhisattva
Joined: 13 May 2002 Posts: 395 Location: Sydney, Australia
|
Posted: Wed Oct 09, 2002 1:44 am Post subject: Re: /bin/sh ?! |
|
|
Kronos wrote: | Didn't know my user kronos was by default using /bin/sh as a shell. How do I set it to /bin/bash? |
I think you'll find that here, /bin/sh is a sym to /bin/bash. While not strictly best practice, at least it fixes your problem.
Otherwise, check out 'usermod -s<shell> <user>'
-- Curious _________________ Are you down with the Hawk? |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Wed Oct 09, 2002 2:54 am Post subject: Re: /bin/sh ?! |
|
|
Curious wrote: | /bin/sh is a sym to /bin/bash. While not strictly best practice |
Just Curious, but why do you consider this "not best practice"? AFAIK, bash adjusts itself to act like the Bourne shell when invoked as 'sh', so there shouldn't be any syntax irregularities. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
Curious Bodhisattva
Joined: 13 May 2002 Posts: 395 Location: Sydney, Australia
|
Posted: Wed Oct 09, 2002 3:21 am Post subject: Re: /bin/sh ?! |
|
|
rac wrote: | Just Curious, but why do you consider this "not best practice"? AFAIK, bash adjusts itself to act like the Bourne shell when invoked as 'sh', so there shouldn't be any syntax irregularities. |
Chet Ramey, Bash Maintainer wrote: | The lesson that has been repeated most often during bash development is that there are dark corners in the Bourne Shell, and people use all of them. In the original description of the Bourne shell, quoting and the shell grammar are both poorly specified and incomplete; subsequent descriptions have not helped much. The grammar presented in Bourne's paper describing the shell distributed with the Seventh Edition of Unix is so far off that it does not allow the command who|wc. In fact, as Tom Duff states:
"Nobody really knows what the Bourne shell's grammar is. Even examination of the source code is little help."1
The POSIX.2 standard includes a yacc grammar that comes close to capturing the Bourne shell's behavior, but it disallows some constructs which sh accepts without complaintand there are scripts out there that use them. It took a few versions and several bug reports before bash implemented sh-compatible quoting, and there are still some "legal" sh constructs which bash flags as syntax errors. Complete sh compatibility is a tough nut. |
Like I said, it's only technically not. I don't think anyone will come across this in day to day use. And this was in 1994. Maybe things have changed!
-- Curious _________________ Are you down with the Hawk? |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Wed Oct 09, 2002 4:22 am Post subject: |
|
|
Thanks for taking the time to dredge that out, Curious. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
|