Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How do properties effect script? Post 302077318 by blowtorch on Wednesday 21st of June 2006 06:23:11 AM
Old 06-21-2006
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.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

recursive effect!!

I run the following command in some of my folders... and ended up with a huge mess!! find . -type f -exec perl -e 's/blabla/zzzxxxx/gi' -p -i.bak {} \; I had to kill the process and later when I checked with one of my folders.. ls vaditerm.dt.bak vaditerm.dt.bak.bak... (2 Replies)
Discussion started by: sskb
2 Replies

2. UNIX for Advanced & Expert Users

Effect of Preemptive Kernel

hi there, i am porting kernel 2.2 driver program to kernel 2.6. for some extent i am successfull but some times the system gets hanged. what might be the problem? i am not able to get any help from log messages as nothing is being printed at that moment. hey does this kernel preemptiveness and... (2 Replies)
Discussion started by: sriram.ec
2 Replies

3. Solaris

will this script in crontab effect SUN 9??

Hi all, I work in Sun Solaris 9. I am plan to put the following script(remove90dysOldrfiles.sh) in CRONTAB for removing huge huge number of files those are older than 90 days from different directory. In the Crontab i will set the time for everymidnight it will search 90days older file and... (2 Replies)
Discussion started by: thepurple
2 Replies

4. Virtualization and Cloud Computing

The Network Effect - Part 1

2008-10-31T22:46:14+01:00 http://geekandpoke.typepad.com/.a/6a00d8341d3df553ef010535ce543e970c-800wi Nicholas Carr (and here) has some problems with Tim O'Reilly's theory about the cloud and the network effect. http://feeds.feedburner.com/~f/GeekAndPoke?i=OFn0M... (0 Replies)
Discussion started by: Linux Bot
0 Replies

5. Shell Programming and Scripting

Nullify the effect of Trap command in later part of the script

Hi All, i have an issue regarding trap command. i have specified trap function in the beginning of the script to catch some signals but in the later part of the script i want to remove the effect of this. Can anybody help me out of this. for e.g. pressing Ctrl+C for the first time should... (2 Replies)
Discussion started by: vikas_kesarwani
2 Replies

6. Shell Programming and Scripting

Reading the Properties File From Shell script

Hi, I am new to the shell script please I need help for following question. I have properties file name called "com.test.properties" I have No of key values in this properties. com.person.name = xyz com.person.age = 55 com.person.address = hello I want read this properties but i... (1 Reply)
Discussion started by: venukjs
1 Replies

7. UNIX for Dummies Questions & Answers

What crontab is in effect after reboot

A basic cron question and I hope I explain it enough. If a person creates a file to use with cron and issues the followin command: crontab I understand this will set the cron entries to whatever is in . However, if we now edit the crontab with: crontab -e and save, how does cron... (3 Replies)
Discussion started by: niswonp
3 Replies

8. Shell Programming and Scripting

script to parse the properties file

Hi Friends, I have a requirement to parse a properties file having a key=value pairs. i need to count the number of key value pairs in the properties file and iterate through each key-value pair. I have written the script to read the number of lines from the property file, but cannot... (2 Replies)
Discussion started by: prashdeep
2 Replies

9. Shell Programming and Scripting

Alias has no effect in script

It doesn't have effect in script but it works on the terminal root@server:/opt/kvm/usecases/logs# alias echo='echo -e' root@server:/opt/kvm/usecases/logs# echo "xxxx\n" xxxx root@server:/opt/kvm/usecases/logs# cat xx.sh #!/bin/bash alias echo='echo -n' echo "sssf \n" ... (3 Replies)
Discussion started by: yanglei_fage
3 Replies

10. Shell Programming and Scripting

awk set $1 to itself, effect on $0

jotne posted an interesting thread an hour or two ago, and ended up with the following: awk '{$1=$1} /^+$/' file I had a question about the effect of $1=$1 assignment, and thought it better to start a new thread, because it's really a different topic. $ cat test.sh set -v echo " abcd" | awk... (3 Replies)
Discussion started by: hanson44
3 Replies
rm(1)							      General Commands Manual							     rm(1)

NAME
rm - remove files or directories SYNOPSIS
file ... DESCRIPTION
The command removes the entries for one or more files from a directory. If an entry was the last link to the file, the file is destroyed. Removal of a file requires write and search (execute) permission in its directory, but no permissions on the file itself. However, if the sticky bit is set on the directory containing the file, only the owner of the file, the owner of the directory, or a user having appropri- ate privileges can remove the file. If a user does not have write permission for a file to be removed and standard input is a terminal, a prompt containing the file name and its permissions is printed requesting that the removal of the file be confirmed (see Access Control Lists below). A line is then read from standard input. If that line begins with the file is deleted; otherwise, the file remains. No questions are asked when the option is given or if standard input is not a terminal. If file is of type directory, and the option is not specified, and either the permissions of file do not permit writing and standard input is a terminal or the option is specified, writes a prompt to standard error and reads a line from standard input. If the response does not begin with it does nothing more with the current file and goes on to any remaining files. If file is a symbolic link, then only the symbolic link is removed. The file or directory pointed to by the symbolic link is not affected. If any of the intermediate path components of file happens to be a symbolic link, then follows the symbolic link and removes the file. Options recognizes the following options: Force each file or directory to be removed without prompting for confirmation, regardless of the permissions of the entry. This option also suppresses diagnostic mes- sages 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 option should be used while redirecting standard error output to This option ignores any previous occurrence of the option. Write a prompt to standard error requesting confirmation before removing each entry. This option ignores any previous occurrence of the option. For each argument that is a directory, this option causes to recursively delete the entire contents of that directory before removing the directory itself. When used in conjunction with the option, asks whether to examine each directory before interactively removing files in that directory and again afterward to confirm removing the directory itself. The option will descend to arbitrary depths in a file hierarchy and will not fail due to path length limitations unless the length of file name, specified by the user exceeds system limitations. Equivalent to Access Control Lists If a file has optional ACL entries, displays a plus sign after the file's permissions. The permissions shown summarize the file's value returned by (see stat(2)). See also acl(5). EXTERNAL INFLUENCES
Environment Variables provides a default value for the internationalization variables that are unset or null. If is unset or null, the default value of "C" (see lang(5)) is used. If any of the internationalization variables contains an invalid setting, will behave as if all internationalization variables are set to "C". See environ(5). If set to a non-empty string value, overrides the values of all the other internationalization variables. determines the interpretation of file names as single and/or multi-byte characters, the classification of characters as printable, and the characters matched by character class expressions in regular expressions. determines the locale that should be used to affect the format and contents of diagnostic messages written to standard error and informa- tive messages written to standard output. determines the location of message catalogues for the processing of International Code Set Support Single- and multibyte character code sets are supported. DIAGNOSTICS
Generally self-explanatory. Note that the option does not suppress all diagnostic messages. It is forbidden to remove the file in order to avoid the consequences of using a command such as: If a designated file is a directory, an error comment is printed unless the or option is used. RETURN VALUE
exits with one of the following values: If the option is not specified, 0 is returned only if all the named directory entries (the arguments specified in the command) are removed. If the option is specified, then all the existing named directory entries are removed. If any of the named directory entries are non-existent, still returns a zero. An error occurred. EXAMPLES
Remove files with a prompt for verification: Remove all the files in a directory: Note that the previous command removes files only, and does not remove any directories in Remove a file in the current directory whose name starts with or or some other character that is special to the shell: etc. Remove a file in the current directory whose name starts with some strange (usually nonprinting, invisible) character or perhaps has spaces at the beginning or end of the filename, prompting for confirmation: If is not unique in the directory, enter when each of the other files is prompted. A powerful and dangerous command to remove a directory is: or which removes all files and directories from without any prompting for verification to remove the files or the directories. This command should only be used when you are absolutely certain that all the files and directories in as well as itself are to be removed. DEPENDENCIES
NFS does not display a plus sign to indicate the existence of optional access control list entries when asking for confirmation before removing a networked file. SEE ALSO
rmdir(1), unlink(2), acl(5). STANDARDS CONFORMANCE
rm(1)
All times are GMT -4. The time now is 04:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy