The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
will this script in crontab effect SUN 9?? thepurple SUN Solaris 2 10-05-2007 01:31 AM
properties for vi shriashishpatil UNIX for Dummies Questions & Answers 2 04-20-2007 10:27 AM
Temporarily disable effect of set -e in ksh ugeek Shell Programming and Scripting 1 03-28-2007 01:21 AM
Effect of Preemptive Kernel sriram.ec UNIX for Advanced & Expert Users 2 03-14-2006 09:43 PM
recursive effect!! sskb UNIX for Dummies Questions & Answers 2 01-30-2003 08:05 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-21-2006
Registered User
 

Join Date: Jun 2006
Posts: 28
How do properties effect script?

Hi,

I have noticed that rm -if will perform completely different to rm -fi. Whats the pattern of how I put my options to the script in relation to how it will act.

i.e

rm -fi treat the remove as interative but
rm -if treats it as forced

Thansk, Chris.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-21-2006
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,325
To be honest, I was surprised to find that the -f and -i options work together. But on checking the man page (on HP and Sun), I found the following:
On HP-UX:
HTML Code:
rm recognizes the following options:

           -f   Force each file or directory to be removed without prompting
                for confirmation, regardless of the permissions of the
                entry.  This option also suppresses diagnostic messages
                regarding nonexistent operands.

                This option does not suppress any diagnostic messages other
                than those regarding nonexistent operands.  To suppress all
                error message and interactive prompts, the -f option should
                be used while redirecting standard error output to
                /dev/null.

                This option ignores any previous occurrence of the -i
                option.

 Hewlett-Packard Company            - 1 -   HP-UX Release 11i: November 2000

 rm(1)                                                                 rm(1)

           -i   Write a prompt to standard error requesting confirmation
                before removing each entry.
On Solaris:
HTML Code:
    -f    Removes all files (whether write-protected or not)  in
           a  directory  without  prompting the user. In a write-
           protected directory, however, files are never  removed
           (whatever  their permissions are), but no messages are
           displayed. If the removal of a write-protected  direc-
           tory  is  attempted,  this option will not suppress an
           error message.

     -i    Interactive. With this option, rm prompts for  confir-
           mation  before removing any files. It overrides the -f
           option and remains in  effect  even  if  the  standard
           input is not a terminal.
So if you run "rm -fi" on HP, it is interactive, but "rm -if" is forced as specified in the man page. But on Solaris, if "-i" is specified, then the "-f" is ignored regardless of where it occurs.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:06 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0