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 ).
So, what's the way to customize sh? Is there such a configuration file, or is it a whole different deal? Thank you
What's the equivalent to .bashrc for sh?
- Rattlehead
- Posts: 368
- Joined: Thu 11 Sep 2008, 11:40
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.
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.
- Rattlehead
- Posts: 368
- Joined: Thu 11 Sep 2008, 11:40
Yes, you're right. I did the search and /bin/sh is a link to /bin/bash.There is a link so that a script that runs sh shell is actually
running bash shell.
But then, I wonder, shouldn't all the bash alias work just fine in this pseudo sh?
Funny, if in sakura (bash) I execute
Code: Select all
sh
But if, then, I open a new Sakura terminal, here come the alias again...
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:
~/.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.
When sh is linked to bash I get this:
Code: Select all
# echo $SHELL
/bin/sh
#
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.
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!
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!
- Rattlehead
- Posts: 368
- Joined: Thu 11 Sep 2008, 11:40
Thank you, I tried that, but no luck. Here's what I did.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.
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: Select all
source ~/.profile
So anyways, thank you for the suggestions, I'm glad I've learned a bit more about how terminals work.