On Sat, 23 Jun 2001, David Turetsky wrote:
> I would like 'calendar -a' to be evoked the first time I log in
> each day to my Debian Linux system
> 
> That doesn't sound like a task for cron
> 
> Where can I put that?

If i want programs to be started when you login (i am presuming under X)
then a good place is your .bash_profile which should be in your home dir.
I dont know how its called in debian it could be one of .bashrc .profile or the
one mentioned above.
Anyway that file gets read upon you logging in, so if you require a program to
be started upon login simply add (at the bottom of the file) a statement like;

# Ask if we should start <program>
echo "Start program ? enter y/n"
read x
if [ "$x" = "n" -o "$x" = " " ]; then
 echo "Aborting..."
else
# Check and see if the program is already running.
 PS=`ps ax | grep -v grep | grep program | awk '{print $1}' | wc -c`
  if [ "$PS" -gt "0" ]; then
   echo "program is already running"
  else
   /sbin/program &
  fi
fi

Simply substitute "program" with your desired program name.

As another example i have attached my .bash_profile, it has several interesting
things in it.

> 
> --
> David Turetsky
> ---------------
> richSOB.com

-- 
Regards Richard
[EMAIL PROTECTED]
http://people.zeelandnet.nl/pa3gcu/

# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

alias people='telnet people.zeelandnet.nl'
alias DX='telnet 195.57.18.13 41112'

stty erase "^H"         # Make sure the backspace key erases.

# mesg n

biff n

export VISUAL=/usr/bin/joe
export LD_LIBRARY_PATH=$HOME/rvplayer5.0
PATH=$PATH":$HOME/rvplayer5.0"

export REPLYTO="[EMAIL PROTECTED]"

#COLOUR=45
#if [ $USER = 'root' ] ; then
#        COLOUR=41  #redPATH="$PATH:/usr/local/bin"
#fi

#ESC="\033"
## STYLE=';1m' # bold; choose which one to use

## PS1="\[$ESC[$COLOUR;37$STYLE\]$USER:\[$ESC[37;40$STYLE\]\w\\$ " # Origanal
#PS1="\[$ESC[$COLOUR;37$STYLE\]$USER: >\[$ESC[37;40$STYLE\] "
#PS2="> "

echo "Accept ttylinkd requests y/n ? "
read x

if [ "$x" = "n" -o "$x" = " " ]; then
        mesg n
else
        mesg y
fi


if [ -f /tmp/.X0-lock ]; then
        echo "X already running..."
else
#       if [ -x /home/pa3gcu/scripts/own-work/setsound ]; then
#                /home/pa3gcu/scripts/own-work/setsound
#	fi
        startx -- -bpp 16 2>&1 &> /var/log/startx.log &
fi
#
# xhost +localhost

cal &

Reply via email to