LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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
  Search this Thread
Old 11-13-2013, 10:27 AM   #1
nyloc
Member
 
Registered: Aug 2007
Location: Melbourne
Posts: 111

Rep: Reputation: 17
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, 10:45 AM   #2
GazL
LQ Veteran
 
Registered: May 2008
Posts: 7,116

Rep: Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275
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, 11:55 AM   #3
fskmh
Member
 
Registered: Jun 2002
Location: South Africa
Distribution: Custom slackware64-current
Posts: 308

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

Original Poster
Rep: Reputation: 17
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, 03:25 AM   #5
metageek
Member
 
Registered: Jun 2007
Location: Farmington, CT
Distribution: Slackware64
Posts: 208

Rep: Reputation: 45
This was already the case in 14.0
 
Old 11-15-2013, 04:39 AM   #6
GazL
LQ Veteran
 
Registered: May 2008
Posts: 7,116

Rep: Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275
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, 06:46 PM   #7
nyloc
Member
 
Registered: Aug 2007
Location: Melbourne
Posts: 111

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

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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, 07:10 PM   #9
nyloc
Member
 
Registered: Aug 2007
Location: Melbourne
Posts: 111

Original Poster
Rep: Reputation: 17
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, 07:27 PM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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, 02:00 PM   #11
GazL
LQ Veteran
 
Registered: May 2008
Posts: 7,116

Rep: Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275
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 02:07 PM.
 
Old 11-16-2013, 02:06 PM   #12
GazL
LQ Veteran
 
Registered: May 2008
Posts: 7,116

Rep: Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275Reputation: 5275
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, 05:11 PM   #13
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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



Similar Threads
Thread Thread Starter Forum Replies Last Post
KDE 4 Autostart Program Bash Script to Write Autostart Bash Scripts for You! jdmcdaniel3 SUSE / openSUSE 1 05-03-2010 07: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 01:23 AM
no bash commands in new slack installation trebek Slackware 5 05-30-2007 04:33 PM
[SOLVED] Bash profile problem on Slack 10.2 brooky9999 Slackware 10 03-30-2007 06:15 AM
Slack 9 and Bash Scripts labr@ Slackware 0 06-27-2003 04:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:07 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
Open Source Consulting | Domain Registration