Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 28 Aug 2014, 07:14
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
What's the equivalent to .bashrc for sh?
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [9 Posts]  
Author Message
Rattlehead


Joined: 11 Sep 2008
Posts: 213
Location: Madrid, Spain

PostPosted: Sat 15 Mar 2014, 06:42    Post subject:  What's the equivalent to .bashrc for sh?  

I am trying to use the Quake-style terminal Stjerm, but it doesn't recognize all the customizations I've been adding to my .bashrc (used in Sakura).

Stjerm's prompt starts with 'sh', so I guess sh uses a different configuration file. I've searched the computer for a .shrc file, equivalent to .bashrc, but nothing shows. Also, I have read the sh man page, and searched the Internet, but haven't found anything (it doesn't help that the .sh termination is commonly used in script names Rolling Eyes ).

So, what's the way to customize sh? Is there such a configuration file, or is it a whole different deal? Thank you
Back to top
View user's profile Send private message 
trapster


Joined: 28 Nov 2005
Posts: 1999
Location: Maine, USA

PostPosted: Sat 15 Mar 2014, 07:45    Post subject:  

Have a look in ~/.Xdefaults

Then see Here

_________________
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Puppeee4.31 + 1.0, Puppy4.10 + Lupu52
Currently using Slacko AND lupu52 w/ fluxbox
Back to top
View user's profile Send private message Visit poster's website 
Rattlehead


Joined: 11 Sep 2008
Posts: 213
Location: Madrid, Spain

PostPosted: Sat 15 Mar 2014, 12:13    Post subject:  

Thank you for the links, Trapster, they are a great resource, but, from what I've seen, they refer to stjerm-specific configuration (say, colors, autohide on-off, key to press to make the terminal pop in...), rather than to sh itself.

I have never had to tweak .Xdefaults, because the stjerm pet I installed also included a small script called stjerm-bin, that takes care of all that kind of stuff.

You made me realize I should have defined better what I meant by 'configuration'. The kind of configuration I was referring to is rather the list of alias and functions I go creating along the way and adding to .bashrc. For example, that typing s enter takes you to seamonkey, typing c instead of clear... That kind of customization that makes your life more comfortable...

If I could have that customization plus the emerging terminal it would be the best of both worlds... I was thinking maybe of separating such configuration instructions as a different text file, and sourcing it in both bash and sh so I can use it in any terminal...

I find strange that such aspect of sh is not explained out there, but, again, sh is a very short word, and usable in several contexts, which makes finding possible information harder.
Back to top
View user's profile Send private message 
WillM

Joined: 30 Dec 2009
Posts: 139
Location: Oakland, California

PostPosted: Sun 16 Mar 2014, 14:07    Post subject:  

HI Rattlehead,
In the /etc/passwd file you could change your user log in shell from /bin/sh to /bin/bash. Then restart the computer.
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3259
Location: Ontario

PostPosted: Mon 17 Mar 2014, 16:36    Post subject:  

I believe that only bash 3.0 is installed in Puppy linux.

There is a link so that a script that runs sh shell is actually
running bash shell.

I would have to run pfind to find that link.

_____________________________________
Back to top
View user's profile Send private message 
Rattlehead


Joined: 11 Sep 2008
Posts: 213
Location: Madrid, Spain

PostPosted: Mon 17 Mar 2014, 20:10    Post subject:  

Quote:
There is a link so that a script that runs sh shell is actually
running bash shell.


Yes, you're right. I did the search and /bin/sh is a link to /bin/bash.

But then, I wonder, shouldn't all the bash alias work just fine in this pseudo sh? Confused

Funny, if in sakura (bash) I execute

Code:
sh


From them on the terminal does not recognize my alias.
But if, then, I open a new Sakura terminal, here come the alias again...

Confused Confused Confused
Back to top
View user's profile Send private message 
WillM

Joined: 30 Dec 2009
Posts: 139
Location: Oakland, California

PostPosted: Tue 18 Mar 2014, 11:21    Post subject:  

If /bin/sh is a link to bash, bash will not behave the same when called as /bin/bash.
When sh is linked to bash I get this:
Code:

#  echo $SHELL
/bin/sh
#

~/.bash_profile which will source .bashrc, if it is present, and is read by bash only.
sh does not read .bash_profile. That is why aliases in .bashrc don't work.
sh will read ~/.profile so you could move .bash_profile to .profile, and have that source a file
with aliases, and other stuff.

On a side note, when invoked as sh, Bash enters POSIX mode.
Back to top
View user's profile Send private message 
drongo


Joined: 10 Dec 2005
Posts: 353
Location: UK

PostPosted: Tue 18 Mar 2014, 13:50    Post subject: Cut down shell  

I thought Puppy didn't have a full shell as that would be too big for a small distro.

Isn't it mostly Busybox with some additional full commands from Bash (or is it Ash?)

But I could well be very wrong about this!
Back to top
View user's profile Send private message 
Rattlehead


Joined: 11 Sep 2008
Posts: 213
Location: Madrid, Spain

PostPosted: Tue 18 Mar 2014, 21:19    Post subject:  

Quote:
sh does not read .bash_profile. That is why aliases in .bashrc don't work.
sh will read ~/.profile so you could move .bash_profile to .profile, and have that source a file
with aliases, and other stuff.


Thank you, I tried that, but no luck. Here's what I did.

There was no .bash_profile file. There wasn't a ~/.profile, either, so what I did was copying .bashrc as ~/.profile, and then restarting X (stjerm didn't want to die with ctrl+c). It still did not recognize the alias. However, after I source .profile from sjterm,

Code:
source ~/.profile


, stjerm does start to recognize the alias, so it seems a logic conclusion that stjerm does not read neither .bashrc nor .profile at startup. Maybe the program is in development and it still can't be configurated? Another limitation that I have just noticed, and which makes it hard to make it a full time substitute for Sakura, is that it does not have tab autocompletion.

So anyways, thank you for the suggestions, I'm glad I've learned a bit more about how terminals work.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [9 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0681s ][ Queries: 11 (0.0033s) ][ GZIP on ]