LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-20-2010, 11:02 AM   #1
wolfv
LQ Newbie
 
Registered: Feb 2010
Posts: 26

Rep: Reputation: 1
Question run a prompt at logout or shutdown?


Is there a way to run a prompt at logout or shutdown? I added the following code to .bash_logout, but apparently the “read” command doesn't work from there.
Code:
echo "Make a backup now? (y)" 
read answer 
if [ "$answer" != "y" ] 
then 
	echo  "Backup aborted."
fi
I am using Ubuntu 9.10

Thank you.
 
Old 02-20-2010, 12:24 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Try to use the whole path
Does the echo command works ?
 
Old 02-20-2010, 01:50 PM   #3
wolfv
LQ Newbie
 
Registered: Feb 2010
Posts: 26

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by repo View Post
Try to use the whole path
Does the echo command works ?
The whole path of what? Its just an echo and read. After I get that working, I will add a call to a script complete with path.

echo command is not printing. I added "touch" and "sleep" commands to the .bash_logout:
Code:
touch bash_test
echo "Make a backup now? (y)" 
sleep 5
read answer 
if [ "$answer" != "y" ] 
then 
	echo  "Backup aborted."
fi
When I logout, I don't see the echo. When I log back in, no bash_test file exists.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shutdown/Logout buttons addr1 Arch 2 10-07-2009 05:06 AM
How to enable Gnome logout options to exit to the command prompt GreenJelly Fedora 2 07-21-2007 02:34 PM
Logout twice to shutdown mhl Linux - Newbie 13 08-31-2003 05:02 PM
Run commands at logout/shutdown sbaguz Linux - General 2 08-21-2003 11:55 AM
Is there any shutdown/logout logs? Cray2 Linux - Software 21 07-28-2003 11:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:33 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration