The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Filesystems, Disks and Memory
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 10-01-2006
hegemaro hegemaro is offline
Registered User
 

Join Date: Feb 2006
Location: Schenectady, NY
Posts: 130
I don't see how that command could have wiped the ps binary as there is no redirection to a file, only a pipeline into another command. A useful trick in ksh is to set the noclobber option which prevents accidental overwrite of existing files -- even for root.

# set -o noclobber
# /usr/ucb/ps -auxww 3589 > out
# /usr/ucb/ps -auxww 3589 > out
ksh: out: file already exists


Use the >| syntax for force an overwrite:
# /usr/ucb/ps -auxww 3589 >| out
Reply With Quote