LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-24-2011, 12:41 PM   #1
Ribo01
Member
 
Registered: Aug 2010
Posts: 103

Rep: Reputation: 5
making sh shell interactive ?


Hello y'all. I would lke you guys to help out please. Have few questions I need y'all to help with .#1-how can I make my sh interactive by default. That I don't have to always type --interactive everytime I log in. I want it to be always interactive. #2- how also do I turn of --posix mode parmanently ? Is there a line I need to drop somewhere or what do i do. Thanks in anticipation.

Last edited by Ribo01; 03-24-2011 at 12:44 PM.
 
Old 03-24-2011, 01:42 PM   #2
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 2,377

Rep: Reputation: 960Reputation: 960Reputation: 960Reputation: 960Reputation: 960Reputation: 960Reputation: 960Reputation: 960
sh ?

Assuming that you do not want to cripple or break your system, there is no need to mess with sh.
Generally startup and system scripts use sh, and expect it to act in posix mode. changing those factors would be stupid, and likely to cause both overt major and minor subtle problems.

If you are having to force interactive mode for sessions, there is something very odd about your system. I have never encountered a system that required that, and I have been doing this a LONG time!

You have another shell that is more commonly used for user scripts and both interactive and automated sessions. It is most likely bash, ksh, zsh or a variant. Why are you not using that shell as your logon default?

When did this start being a problem? Was it like this from install, or have you made recent changes that triggered this behavior?

What version of what distribution are we dealing with?

I have many more questions, but with those answers we can make a start.
 
Old 03-24-2011, 01:55 PM   #3
Ribo01
Member
 
Registered: Aug 2010
Posts: 103

Original Poster
Rep: Reputation: 5
Hey Wpeckham . Thanks anyway, yeah ma default shell really is BASH. And honestly, everything works fine. Am just an inquisitive one that is tying to know everything and also the possibility of learning it all. I still need my othe question answered. Thanks. Distro Red hat.
 
Old 03-25-2011, 10:58 AM   #4
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 2,377

Rep: Reputation: 960Reputation: 960Reputation: 960Reputation: 960Reputation: 960Reputation: 960Reputation: 960Reputation: 960
sh shell --interactive

Normally you do not need to specify --interactive (or -i : check your shell man page) to force an interactive session. The shell should I/O is connected to a tty (including pseudoTTY) device and make that decision intelligently. It CAN be forced, but on a well designed system should rarely NEED to be.

Bash only runs in POSIX mode when called as 'sh' and not as 'bash' or when that mode is forced by a command-line option.

Again, for detail check your MAN pages and the web pages for your distribution for additional detail.
 
Old 03-25-2011, 03:03 PM   #5
Ribo01
Member
 
Registered: Aug 2010
Posts: 103

Original Poster
Rep: Reputation: 5
Wpeckham, thanks again. Really, everything works fine, and I actually run BASH shell by default. What I told you earlier is all about a learning process. I actually created a another user and configured the user to run on sh shell. So its was in the process I realize I learnt that a lot f things work differently and that sh was not interactive by default of its not the login shell. So hope you understand me now . Thanks anyway.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Making interactive programs Xurs Programming 5 06-16-2010 05:44 PM
Making an init script interactive valcaro SUSE / openSUSE 1 04-27-2007 04:05 PM
how to know if the shell is interactive or not? anupamsr Linux - Newbie 2 01-20-2007 08:31 AM
interactive and non-interactive shell linuxjamil Programming 3 09-03-2006 09:42 PM
Making shell scripts interactive using dialog saurabh142857 Programming 2 01-03-2005 12:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration