Quote:
Gollum try using pidof [process] instead of ps
Thanks, that worked nicely sinetific.
Code:
bye=`pidof xscreensaver` && kill $bye && echo proccess dies || echo no such process
One of my favorites about bash is aliases.
Code:
# emerge aliases
alias emask="echo `$1` /etc/portage/package.keywords"
alias es="emerge -s"                                                   
alias ep="emerge -pv"
alias e="sudo emerge"
alias emerge='sudo emerge'
    
# directory aliases                                                    
alias ..='cd ..'                                                       
alias ...='cd ../..'                                                   
alias ....='cd ../../..'                                               
alias c="clear"
alias cb="bash_issue"
alias ls="ls --color=always"
alias ll="ls --color -l"                                               
    
# misc aliases
alias grep='grep --colour=auto'                                        
alias killwine="killall -9 wine; killall -9 wineserver"                
alias recal="history | grep `$1`"                                      
alias lock='xscreensaver-command -lock'                                
alias r00t='sudo -s -H'  
alias svi='sudo vim'
alias smv='sudo mv'
alias vi="vim"                                                         
alias nat="nautilus --no-desktop"                                      
alias 3d="sudo 3ddeskd  --acquire 700 2>1&"                            
alias screengrab="import -window root ~/screen.jpg"                    
alias lvim='vim -c "normal '\''0"'                                     
alias mkisofs="mkisofs -rJV"
alias torrget="btdownloadcurses.py --minport 50555 --maxport 65500"    
alias cal2="cal -3; echo -e Todays date is `date +%B\ %d`"             
alias scr="screen -r"
alias scl="screen -list"
alias nm="nmap -sS -O -PI -PT"
alias icq="screen -S icq centericq"
alias irc="screen -S irc irssi"
alias mp3="cd ~/music/full-albums/ && screen -S mp3 cplay"
alias get="cd ~/download/torrent-files/ && screen -S get"
_________________________
I sig not