The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > Linux > Ubuntu
.
google unix.com



Ubuntu Ubuntu is a complete desktop Linux operating system, freely available with both community and professional support.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Exit or logout kinai UNIX for Dummies Questions & Answers 1 04-14-2008 09:44 AM
.logout sharif SUN Solaris 3 12-24-2007 05:08 AM
auto logout lethgowerboy UNIX for Dummies Questions & Answers 2 11-21-2007 04:16 AM
.logout help 2dumb Shell Programming and Scripting 3 05-10-2007 12:49 PM
logout zam UNIX for Dummies Questions & Answers 2 12-28-2006 07:23 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-26-2009
zexin zexin is offline
Registered User
  
 

Join Date: May 2009
Posts: 1
Smile Help with a logout scrpt

Hi, I'm new to Linux and this forums. I was working on a logout script
and was wondering if anyone could help me out.

What I'm trying to do is to delete the content of the ~/tmp/ directory
and also to perform a check if any processes are currently running befor logout.

this is what I have

# ~/.bash_logout: executed by bash(1) when login shell exits.

# when leaving the console clear the screen to increase privacy

if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi


ps -u `whoami` | grep -v $$ | grep -v 'PID TTY'

if ( $? == 0 ) then
echo ""
echo "WARNING - YOU HAVE RUNNING JOBS!"
echo ""
echo "press return to log out"
read answer

endif

rm -rf /tmp/*
rm -rf/var/tmp/*

but it doesn't seem to work
  #2 (permalink)  
Old 05-28-2009
mark54g mark54g is offline
Registered User
  
 

Join Date: May 2008
Posts: 366
~ refers to your home directory, however, the commands you wrote are to delete the files you own in /tmp and /var/tmp.

That would also be counter intuitive, as you could simply cron the deletion.
Closed Thread

Bookmarks

Tags
deleting, logout, logout script, tmp

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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




All times are GMT -4. The time now is 03:44 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0