Sponsored Content
Full Discussion: Issues with setting Aliases
Top Forums Shell Programming and Scripting Issues with setting Aliases Post 302966095 by mohtashims on Monday 8th of February 2016 06:42:20 AM
Old 02-08-2016
Linux

Quote:
Originally Posted by gull04
Hi,

Try the following;

Code:
-bash-3.2$ alias rm="rm -i"
-bash-3.2$ rm test
rm: remove test (yes/no)? yes
-bash-3.2$

Regards

Gull04
That suggestion made a lot of sense to me.

I did as you said Gull that works.

So the point is rm -rf does not prompt for confirmation while rm -r works and asks for confirmation. Also rm -irf also works.

Can anyone now explain why is this so and how to fix so that "-i" flag works with "-f" flag ?

Last edited by mohtashims; 02-08-2016 at 07:50 AM..
 

8 More Discussions You Might Find Interesting

1. Programming

aliases

Hi. I have a C program that is using the **environ pointer and I am trying to set up aliases for a system("/bin/ksh") call. This works for other environment variables but not for the aliases. Does anyone know if this can be done? Thanks ahead of time. (1 Reply)
Discussion started by: mluey61
1 Replies

2. UNIX for Dummies Questions & Answers

aliases

Is there a way to view what aliases are running on a given session? (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

3. Shell Programming and Scripting

etc aliases

Hello: i have several server with own etc aliases. right now i want to combine it all into a general etc aliases in a new freebsd server. cause it consist hundred thousand of record user inside how to make a shell script to combine it or configure it. all etc aliases record example: ... (0 Replies)
Discussion started by: peterLfs
0 Replies

4. UNIX for Dummies Questions & Answers

Setting aliases

How come if I set an alias as such: alias dt 'date "+%Y-%m-%d %H:%M:%S"' it will work as intended, ie the command 'dt' does prompt the date and time, but not when invoked through a script as such: #!/bin/sh alias dt 'date "+%Y-%m-%d %H:%M:%S"' The OS is FreeBSD 7.1. Thanks in advance (4 Replies)
Discussion started by: figaro
4 Replies

5. Solaris

Help with beginner issues setting up ZFS??

Hi, I'm new to Solaris 11. The goal is to set up a ZFS raid-Z2 NAS. These are the instructions I've been trying to follow, with no luck: "Setting Up an OpenSolaris NAS Box: Father-Son Bonding" (not allowed to post URL) Issues: 1) Root access is evidently required but I don't... (8 Replies)
Discussion started by: lakedude
8 Replies

6. UNIX for Advanced & Expert Users

Issues in setting up remote syslogging

Hello, I am using Ubuntu Linux and having problems in setting up remote syslogging. Appreciate your help on this. On the server unix host, I have made following changes. uncommented following lines in /etc/rsyslog.conf $ModLoad imudp $UDPServerRun 514 Now i am trying to run rsyslog in... (0 Replies)
Discussion started by: ravi.videla
0 Replies

7. Solaris

Is there a difference between setting a user as nologin and setting it as a role?

Trying to figure out the best method of security for oracle user accounts. In Solaris 10 they are set as regular users but have nologin set forcing the dev's to login as themselves and then su to the oracle users. In Solaris11 we have the option of making it a role because RBAC is enabled but... (1 Reply)
Discussion started by: os2mac
1 Replies

8. Proxy Server

Samba on AIX, issues setting read-only flag on files?

Hello, I am having issues setting the "read-only" flag via Windows Explorer on my AIX Samba share... I have on my AIX 7.1 system installed Samba 3.6.24 and configured, joined to our Windows domain successfully. The samba binaries I got from perzl.org/aix In my smb.conf I have... ... (1 Reply)
Discussion started by: c3rb3rus
1 Replies
yum-aliases(1)															    yum-aliases(1)

NAME
yum aliases plugin SYNOPSIS
yum [options] alias DESCRIPTION
This plugin changes other commands in yum, much like the alias command in bash. There are a couple of notable differences from shell style aliases though. The alias command has three forms: * alias * alias command * alias command result The first form lists all current aliases with their final result, the second form looks up a "command" and shows it's final result or an error message. The last form creates a new alias. Explanation of alias to final result conversion When you type an aliased command, like "yum --disableexcludes UPT lsu" using the default aliases, the yum-aliases plugin first takes the first "command", by skipping over any options, and then looks up the result (in this case "UPT" is converted to "--enablerepo=updates-test- ing"). If there is a match, then it will replace the aliased "command" in the argument list and try again (again skipping over any options). By convention, in the default aliases list, alias "commands" that are in all CAPS only add options so you can join together a chain of them before any real command or aliased command. There are two things that can alter the above, if you have the "recursive" configuration option set to off then alias processing will stop after the first alias to command substitution. Also, like in shell aliases, if the result starts with then alias processing will stop. EXAMPLES
To create a new alias command called "rm" which does the same thing as the command "remove" use: yum alias rm remove To always add the --skip-broken --disableexcludes=all --obsoletes options to the update command (but leaving the upgrade option alone), you could use: yum alias update update --skip-broken --disableexcludes=all --obsoletes To override the default "up" alias to use the above update command, and never ask for confirmation, you could use: yum alias up update -y AUTHORS
James Antill <james@and.org> SEE ALSO
yum-utils(1) yum(1) James Antill 31 March 2008 yum-aliases(1)
All times are GMT -4. The time now is 06:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy