Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/bin/sh ?!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Kronos
Tux's lil' helper
Tux's lil' helper


Joined: 05 Sep 2002
Posts: 116
Location: St. Louis area (Wood River, IL)

PostPosted: Wed Oct 09, 2002 1:34 am    Post subject: /bin/sh ?! Reply with quote

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
View user's profile Send private message
Curious
Bodhisattva
Bodhisattva


Joined: 13 May 2002
Posts: 395
Location: Sydney, Australia

PostPosted: Wed Oct 09, 2002 1:44 am    Post subject: Re: /bin/sh ?! Reply with quote

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
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Wed Oct 09, 2002 2:54 am    Post subject: Re: /bin/sh ?! Reply with quote

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
View user's profile Send private message
Curious
Bodhisattva
Bodhisattva


Joined: 13 May 2002
Posts: 395
Location: Sydney, Australia

PostPosted: Wed Oct 09, 2002 3:21 am    Post subject: Re: /bin/sh ?! Reply with quote

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 complaint—and 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
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Wed Oct 09, 2002 4:22 am    Post subject: Reply with quote

Thanks for taking the time to dredge that out, Curious.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum