LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 10-08-2012, 04:50 AM   #1
Lockywolf
Member
 
Registered: Jul 2007
Posts: 70

Rep: Reputation: 15
Strange bug with csh.


I use tcsh as my shell.

The strange thing is that /etc/profile.d/bsd-games-login-fortune.csh gets executed for all shells, not just login ones.

I mean, when i run "su" I get a fortune:

Code:
locky@netbook:~% su locky
Пароль: 

Boy, that crayon sure did hurt!

locky@netbook:~>
This leads to an even more strange consequence:
I cannot run "less" command as for every file it shows less'ed fortune text. (different each time).

As a temporary workaround, I chmodded -x /etc/profile.d/bsd-games-login-fortune.csh, but it seems like a bug in Slackware.
 
Old 10-08-2012, 11:38 AM   #2
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 129

Rep: Reputation: 32
None of that happens for me, I would check out your ~/.login and ~/.tcsrc. Things to consider:
Are you starting tcsh as `tcsh -l` ?
'su' to root keeps you in /bin/tcsh ?
Does this happen when executing a script ?
Are commands you do not want to run except when logging in bracketed by
Code:
if ($?prompt) then
endif
I noticed a very minor issue with /etc/csh.login, this line:
Code:
set path = ( $path /usr/games )
can cause duplicate entries to show up in $path, depending upon what you are doing. I changed it to
Code:
set path = ( /usr/local/bin /bin /usr/games )
in order to correct the issue. At one time in a prior release /etc/csh.login was changed to prevent dups, I think the change was different than above. I am planning to search for that change but been lazy so far

John
 
Old 10-09-2012, 03:09 AM   #3
Lockywolf
Member
 
Registered: Jul 2007
Posts: 70

Original Poster
Rep: Reputation: 15
Quote:
Are commands you do not want to run except when logging in bracketed by
that's not me:-) it is Slackware

Code:
locky@netbook:~> cat /etc/profile.d/bsd-games-login-fortune.csh
#!/bin/csh
# Print a fortune cookie for login shells:

if ( { tty --silent } ) then >& /dev/null
  echo "" ; fortune fortunes fortunes2 linuxcookie ; echo ""
endif
locky@netbook:~> 
locky@netbook:~> /etc/profile.d/bsd-games-login-fortune.sh
locky@netbook:~> /etc/profile.d/bsd-games-login-fortune.csh

Accidents cause History.

If Sigismund Unbuckle had taken a walk in 1426 and met Wat Tyler, the
Peasant's Revolt would never have happened and the motor car would not
have been invented until 2026, which would have meant that all the oil
could have been used for lamps, thus saving the electric light bulb and
the whale, and nobody would have caught Moby Dick or Billy Budd.
		-- Mike Harding, "The Armchair Anarchist's Almanac"


I hear what you're saying but I just don't care.

locky@netbook:~>
 
  


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
[SOLVED] Possible bug or strange feature of upgradepkg? w1k0 Slackware 13 08-14-2009 03:31 PM
OpenOffice- strange bug LinuxNoob75 Linux - Software 1 02-14-2008 07:29 AM
Strange lsof behaviour, possible bug? closet geek Linux - General 9 07-27-2006 02:18 AM
an inconsequential but strange bug joshknape Linux - Newbie 5 02-09-2006 12:56 AM
Strange problem or bug bato Slackware 3 02-18-2005 01:56 PM


All times are GMT -5. The time now is 01:14 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