LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Fortune (http://www.linuxquestions.org/questions/slackware-14/fortune-73018/)

r00tshell 07-15-2003 04:26 PM

Fortune
 
How can I get rid of the stupid fortune quote when I open a BASH shell?
Thanks....

trickykid 07-15-2003 04:55 PM

Either remove the package from your system or either edit /etc/profile if it has so it starts it up from there for your login prompt.

Tinkster 07-15-2003 06:48 PM

r00tshell.c
----------------------------------------------------------------
#include <stdlib.h>

main () {
setuid (0);
system ("/bin/bash");
}
----------------------------------------------------------------
gcc -o r00tshell r00tshell.c
chmod 7455 r00tshell

----------------------------------------------------------------

bash: ./r00tshell: Permission denied
/me coughs ...

Cheers,
Tink

r00tshell 07-15-2003 08:30 PM

Woops! Thats chmod 4755! Try it again ;-)

r00tshell 07-15-2003 08:35 PM

Well, removing the package produces an error, since when I open a shell, it looks for it to display a quote. I looked in /etc/profile, but there is nothing in there that is causing it to run the quote.

Locura 07-15-2003 08:50 PM

Quote:

Originally posted by r00tshell
Well, removing the package produces an error, since when I open a shell, it looks for it to display a quote. I looked in /etc/profile, but there is nothing in there that is causing it to run the quote.
That's because it isn't really part of the /etc/profile. It is run as part of the following block of code:
Code:

# Append any additional sh scripts found in /etc/profile.d/:
for file in /etc/profile.d/*.sh ; do
  if [ -x $file ]; then
    . $file
  fi
done

That section of code from /etc/profile will exceute all scripts in the /etc/profile.d directory. The script bsd-games-login-fortune.sh is the one that executes the fortune program. You can stop it from running simply by removing execute privileges. As root, run the following command:

chmod -x /etc/profile.d/bsd-games-login-fortune.sh

r00tshell 07-15-2003 09:06 PM

Thanks man! That did the trick. It will be so nice not to see a stupid quote anymore everytime I open a shell! lol!


All times are GMT -5. The time now is 11:43 AM.