Sponsored Content
Top Forums Shell Programming and Scripting Confirmation while deleting a file Post 302490538 by citaylor on Tuesday 25th of January 2011 04:23:14 AM
Old 01-25-2011
The "rm" command can be passed the "-i" option for the user to confirm they actually want to delete the file, directory, etc. Lots of administrators alias the "rm" command so that it automatically passes in the "-i" option, especially when they are logged on as root, as accidents can often prove fatal. There are two ways of setting these aliases, to define a shell function or to create an alias. To see your functions type:
Code:
set | more

And to see your aliases type (some shells do not have aliases, so you may get an error):
Code:
alias

You will often see something like:
Code:
alias rm="/usr/bin/rm -i"

I hope this helps...
This User Gave Thanks to citaylor For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Mail delivery confirmation

If I am sending mail with this command: mail .......@whatever.com < filename, is it possible to get delivery confirmation? Thanks (3 Replies)
Discussion started by: CSGUY
3 Replies

2. Forum Support Area for Unregistered Users & Account Problems

need email confirmation resent

we had a power outage shortly after i registered... so my mail server was down for a while... could i get the email confirmation for hackware --> resent please...? thanx... ...william.o.yates...email removed (3 Replies)
Discussion started by: hackware
3 Replies

3. Web Development

Pop up Confirmation Box

Hi, I was writing a simple web application using Perl -CGI. When users try to do some operations, I wanted like a pop-up confirmation box. Is this possible with Perl-CGI? Thanks in advance. Regards, garric (6 Replies)
Discussion started by: garric
6 Replies

4. Shell Programming and Scripting

Search and Replace with Confirmation

Hi, I have created a script which searches and replace the searched text from any file in directory. I want to add a functionality where before replacing the text, script shows the line with the searched text and ask for user confirmation before replacing the text. Can this be done using SED... (18 Replies)
Discussion started by: Abhinav Tyagi
18 Replies

5. Solaris

Netbackup Solaris Client confirmation

Greetings, I have a bunch of Solaris servers that are running Netbackup as a client. I set them up and my backup admin has confirmed that they are being backed up. But what I want to be able to do is run a command from each Solaris client to see some proof from the client side that the files... (1 Reply)
Discussion started by: BrewDudeBob
1 Replies

6. Shell Programming and Scripting

twice confirmation in the script

from one script invoke another script will need to do double confirmation like: 'y' and 'y' exp: echo 'y' | /a/b/c.sh only input 1 'y' in the c.sh, but the c.sh required 2 'y' (twice confirmation) is there anyway get resolve this issue? please help (2 Replies)
Discussion started by: kinx
2 Replies

7. Shell Programming and Scripting

sh script for file received confirmation

I am new at scripting, (and this fourm- so hi guys!) and I was wondering is there something out there that I can use to do the following: I receive a file on an FTP server I would like a script to look at a specifc directory for a certain file and when it arrives it will send an email... (8 Replies)
Discussion started by: mamemlin
8 Replies

8. Shell Programming and Scripting

[Solved] Use of until loop for user confirmation

Below is my script that is using to rename the name of file .Here I am using two methods to pass the both arguments wih script name or run the script and give the input one by one.But my issue is I want to rename the name of the file if user select Y(y) then it should rename the file else select... (4 Replies)
Discussion started by: anuragpgtgerman
4 Replies

9. UNIX for Advanced & Expert Users

Popup needed while reboot - for confirmation

Hi all, I need something like a pop-up while clicking on shutdown button or reboot button in GUI and also while running the command reboot / shutdown / init it should ask some confirmation message.. Do you want to do so..and so. How can i make this possible ? . (4 Replies)
Discussion started by: linuxadmin
4 Replies

10. Forum Support Area for Unregistered Users & Account Problems

Don't receive confirmation mail.

Hi Folks, I just recently registered with the username _Kaede. Unfortunately, I didn't receive any confirmation mail also not when I changed to another address. Help is very appreciated. Thanks and kind regards :) (2 Replies)
Discussion started by: Unregistered
2 Replies
aliasadm(1M)						  System Administration Commands					      aliasadm(1M)

NAME
aliasadm - manipulate the NIS+ aliases map SYNOPSIS
aliasadm -a alias expansion [options comments] optional flags aliasadm -c alias expansion [ options comments] [ optional flags] aliasadm -d alias [ optional flags] aliasadm -e alias [ optional flags] aliasadm -l alias [ optional flags] aliasadm -m alias [ optional flags] aliasadm [-I] [-D domainname] [-f filename] [-M mapname] DESCRIPTION
aliasadm makes changes to the alias map. The alias map is an NIS+ table object with four columns: alias The name of the alias as a null terminated string. expansion The value of the alias as it would appear in a sendmail /etc/aliases file. options A list of options applicable to this alias. The only option currently supported is CANON. With this option, if the user has requested an inverse alias lookup, and there is more than one alias with this expansion, this alias is given prefer- ence. comments An arbitrary string containing comments about this alias. The sendmail(1M) command reads this map in addition to the NIS aliases map and the local /etc/aliases database. OPTIONS
-a Add an alias. -c Change an alias. -d Delete an alias. -e Edit the alias map. -I Initialize the NIS+ aliases database. -l List the alias map. -m Print or match an alias. -D domainname Edit the map in domain domainname instead of the current domain. -f filename When editing or listing the database, use filename instead of invoking the editor. -M mapname Edit mapname instead of mail_aliases. FILES
/etc/aliases mail aliases for the local host in ASCII format ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWnisu | +-----------------------------+-----------------------------+ SEE ALSO
sendmail(1M), attributes(5) NOTES
NIS+ might not be supported in future releases of the SolarisTM Operating Environment. Tools to aid the migration from NIS+ to LDAP are available in the Solaris 9 operating environment. For more information, visit http://www.sun.com/directory/nisplus/transition.html. SunOS 5.10 12 Dec 2001 aliasadm(1M)
All times are GMT -4. The time now is 08:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy