LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 11-13-2013, 09:27 AM   #1
nyloc
LQ Newbie
 
Registered: Aug 2007
Location: Melbourne
Posts: 27

Rep: Reputation: 15
Slack 14.1 bash different in KDE


I have my 14.0 Slackware set to boot to a console so I can then startx manually. The bash shell at boot has username@hostname on the left hand side and includes the changes I make to bsd-games-login-fortune-sh. When I startx and run Konsole the console looks the same. When I test Slack 14.1 the initial boot console is ok but the KDE console has Bash 4.2 on the LHS and my changes to bsd---.sh have not been applied. Any ideas why bash is different in KDE?
 
Old 11-13-2013, 09:45 AM   #2
GazL
Senior Member
 
Registered: May 2008
Posts: 3,231

Rep: Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828
Sounds like kde/konsole is no longer starting the shell as a 'login shell' (which IMO is exactly the right thing to do). non-login shells don't run .profile.

Read the INVOCATION section of man bash for full details.
 
Old 11-13-2013, 10:55 AM   #3
fskmh
Member
 
Registered: Jun 2002
Location: South Africa
Distribution: Slackware64-current multilib
Posts: 225

Rep: Reputation: 52
alt-f2->konsole->Settings->Manage Profiles->Edit Profile->Change command /bin/bash to /bin/bash -l
 
Old 11-15-2013, 12:19 AM   #4
nyloc
LQ Newbie
 
Registered: Aug 2007
Location: Melbourne
Posts: 27

Original Poster
Rep: Reputation: 15
Thanks guys
Gazl:- Yes I agree it is not an actual login shell however any console that does not let me apply, at least, alias rm="rm -i" to it is of no use to me.
fskmh:- that worked thanks. first time in years (10?) that I have had this issue with Slackware.
 
Old 11-15-2013, 02:25 AM   #5
metageek
Member
 
Registered: Jun 2007
Location: manchester, uk
Distribution: Slackware
Posts: 112

Rep: Reputation: 21
This was already the case in 14.0
 
Old 11-15-2013, 03:39 AM   #6
GazL
Senior Member
 
Registered: May 2008
Posts: 3,231

Rep: Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828
Quote:
Originally Posted by nyloc View Post
Thanks guys
Gazl:- Yes I agree it is not an actual login shell however any console that does not let me apply, at least, alias rm="rm -i" to it is of no use to me.
fskmh:- that worked thanks. first time in years (10?) that I have had this issue with Slackware.
The best place for your aliases are in a bashrc file. Slackware's default shell plumbing isn't ideal and it relies on you starting every shell as a login shell in order to get aliases and suchlike working.

This is what I do on my machines to clean it up a little: http://www.linuxquestions.org/questi...ts-4175472234/
 
Old 11-15-2013, 05:46 PM   #7
nyloc
LQ Newbie
 
Registered: Aug 2007
Location: Melbourne
Posts: 27

Original Poster
Rep: Reputation: 15
metageek:- NO it was NOT at least not in the version I have installed !
 
Old 11-15-2013, 05:49 PM   #8
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 1,696

Rep: Reputation: 426Reputation: 426Reputation: 426Reputation: 426Reputation: 426
Quote:
Originally Posted by GazL View Post
The best place for your aliases are in a bashrc file. Slackware's default shell plumbing isn't ideal and it relies on you starting every shell as a login shell in order to get aliases and suchlike working.

This is what I do on my machines to clean it up a little: http://www.linuxquestions.org/questi...ts-4175472234/
Thats the ONLY valid place for it...

If they aren't there, no shell process spawned from that shell (the login shell) will ever have the aliases.
 
Old 11-15-2013, 06:10 PM   #9
nyloc
LQ Newbie
 
Registered: Aug 2007
Location: Melbourne
Posts: 27

Original Poster
Rep: Reputation: 15
If I put the commands in .bashrc then I have to do that for every user, which is what I am trying to avoid (due to laziness - why create many files when one will do).
 
Old 11-15-2013, 06:27 PM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 1,696

Rep: Reputation: 426Reputation: 426Reputation: 426Reputation: 426Reputation: 426
Quote:
Originally Posted by nyloc View Post
If I put the commands in .bashrc then I have to do that for every user, which is what I am trying to avoid (due to laziness - why create many files when one will do).
mostly because it works that way.

In no case is the /etc/profile used after the login shell... so any shell script started by that shell will not get whatever is in it.

Now you CAN make a shared .bashrc... by putting it in the skeleton for account creation. That shared
file CAN include an /etc/profile (or any name you want to call it). In addition, the skeleton file itself gets copied when the users login is created... so again, you don't have to do it yourself.

The major weakness is that users can easily change their version. But that is up to them.
 
Old 11-16-2013, 01:00 PM   #11
GazL
Senior Member
 
Registered: May 2008
Posts: 3,231

Rep: Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828
Quote:
Originally Posted by nyloc View Post
If I put the commands in .bashrc then I have to do that for every user, which is what I am trying to avoid (due to laziness - why create many files when one will do).
Blame the bash developers. Not only did they not add a default system-wide /etc/bashrc file, they made it so that $BASH_ENV only applies to non-interactive shells (unlike $ENV in the traditional bourne familiy shells), so there's no way for the sysadmin to do what you want without putting a .bashrc in /etc/skel to do it and leaving it at the mercy of the idiot users in the hope of them not deleting or otherwise messing it up.

Last edited by GazL; 11-16-2013 at 01:07 PM.
 
Old 11-16-2013, 01:06 PM   #12
GazL
Senior Member
 
Registered: May 2008
Posts: 3,231

Rep: Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828
Quote:
Originally Posted by jpollard View Post
That's the ONLY valid place for it...

If they aren't there, no shell process spawned from that shell (the login shell) will ever have the aliases.
Exactly my point... when it comes to bash at any rate. Other shells were better designed.
 
Old 11-16-2013, 04:11 PM   #13
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 1,696

Rep: Reputation: 426Reputation: 426Reputation: 426Reputation: 426Reputation: 426
Not better. Just different.

The problem the other shells cause by such action is that it makes getting a standard environment much harder to do - you have to first disable everything that is in /etc/<whatever>, AND it makes
running standard scripts (problems due to the changes there) much harder. You don't know if an error
is due to the environment, or the command... (after having to chase through an installation cshell script because it failed due to some rather bogus definitions put in the environment by previous admins, that really didn't know what they were doing).

Personally, I prefer the bourne shell. Smaller executable.

But I do find bash better for simple shell scripting than any of the alternatives. for anything more complex, I much prefer Perl.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
KDE 4 Autostart Program Bash Script to Write Autostart Bash Scripts for You! jdmcdaniel3 Suse/Novell 1 05-03-2010 06:17 AM
How do I install KDE 4.2 to Slackware 12.2? Slack 12.2 comes with KDE 3.5 dustin2128 Slackware - Installation 3 07-24-2009 12:23 AM
no bash commands in new slack installation trebek Slackware 5 05-30-2007 03:33 PM
[SOLVED] Bash profile problem on Slack 10.2 brooky9999 Slackware 10 03-30-2007 05:15 AM
Slack 9 and Bash Scripts labr@ Slackware 0 06-27-2003 03:05 AM


All times are GMT -5. The time now is 04:53 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration