I was having a problem in a shell script that turned out to be cp being
aliased to 'cp -i'. Not a showstopper, once you realise it, but it did beg
the question as to where this file is. I was told to look in /etc/profile.d,
but that doesn't seem to be the case on my CentOS box. I can list aliases, so
I know the file exists, but where?
Anne
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
11-08-2008, 06:00 PM
MHR
Where is the file that sets aliases?
On Sat, Nov 8, 2008 at 10:57 AM, Anne Wilson <cannewilson@googlemail.com> wrote:
> I was having a problem in a shell script that turned out to be cp being
> aliased to 'cp -i'. Not a showstopper, once you realise it, but it did beg
> the question as to where this file is. I was told to look in /etc/profile.d,
> but that doesn't seem to be the case on my CentOS box. I can list aliases, so
> I know the file exists, but where?
>
Try /etc/profile.
mhr
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
11-08-2008, 06:00 PM
Ignacio Vazquez-Abrams
Where is the file that sets aliases?
On Sat, 2008-11-08 at 18:57 +0000, Anne Wilson wrote:
> I was having a problem in a shell script that turned out to be cp being
> aliased to 'cp -i'. Not a showstopper, once you realise it, but it did beg
> the question as to where this file is. I was told to look in /etc/profile.d,
> but that doesn't seem to be the case on my CentOS box. I can list aliases, so
> I know the file exists, but where?
~/.bashrc
FTR, you can use cp to get around this.
--
Ignacio Vazquez-Abrams <ivazqueznet@gmail.com>
PLEASE don't CC me; I'm already subscribed
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
11-08-2008, 06:39 PM
Anne Wilson
Where is the file that sets aliases?
On Saturday 08 November 2008 19:00:56 Ignacio Vazquez-Abrams wrote:
> On Sat, 2008-11-08 at 18:57 +0000, Anne Wilson wrote:
> > I was having a problem in a shell script that turned out to be cp being
> > aliased to 'cp -i'. Not a showstopper, once you realise it, but it did
> > beg the question as to where this file is. I was told to look in
> > /etc/profile.d, but that doesn't seem to be the case on my CentOS box. I
> > can list aliases, so I know the file exists, but where?
>
> ~/.bashrc
>
That seems to be the place to add user-specific ones, but where are the global
default ones?
> FTR, you can use cp to get around this.
I was told that, and also told that it was advisable to use the full path in a
script, particularly if it is to be run by cron. I chose the full-path
solution.
Anne
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
11-08-2008, 06:43 PM
Anne Wilson
Where is the file that sets aliases?
On Saturday 08 November 2008 19:00:12 MHR wrote:
> On Sat, Nov 8, 2008 at 10:57 AM, Anne Wilson <cannewilson@googlemail.com>
wrote:
> > I was having a problem in a shell script that turned out to be cp being
> > aliased to 'cp -i'. Not a showstopper, once you realise it, but it did
> > beg the question as to where this file is. I was told to look in
> > /etc/profile.d, but that doesn't seem to be the case on my CentOS box. I
> > can list aliases, so I know the file exists, but where?
>
> Try /etc/profile.
>
That doesn't appear to define cp, l, ll, ls, mv, rm or which, all of which are
listed by the command 'alias'.
Anne
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
11-08-2008, 07:09 PM
Ignacio Vazquez-Abrams
Where is the file that sets aliases?
On Sat, 2008-11-08 at 19:39 +0000, Anne Wilson wrote:
> That seems to be the place to add user-specific ones, but where are the global
> default ones?
All global default files are in /etc/skel.
--
Ignacio Vazquez-Abrams <ivazqueznet@gmail.com>
PLEASE don't CC me; I'm already subscribed
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
11-08-2008, 07:38 PM
"William L. Maltby"
Where is the file that sets aliases?
On Sat, 2008-11-08 at 19:39 +0000, Anne Wilson wrote:
> On Saturday 08 November 2008 19:00:56 Ignacio Vazquez-Abrams wrote:
> > On Sat, 2008-11-08 at 18:57 +0000, Anne Wilson wrote:
> > > I was having a problem in a shell script that turned out to be cp being
> > > aliased to 'cp -i'. Not a showstopper, once you realise it, but it did
> > > beg the question as to where this file is. I was told to look in
> > > /etc/profile.d, but that doesn't seem to be the case on my CentOS box. I
> > > can list aliases, so I know the file exists, but where?
> >
> > ~/.bashrc
> >
> That seems to be the place to add user-specific ones, but where are the global
> default ones?
/etc/bashrc
But be aware that root-specific ones are here on 5.x
# grep alias .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
>
> > FTR, you can use cp to get around this.
>
> I was told that, and also told that it was advisable to use the full path in a
> script, particularly if it is to be run by cron. I chose the full-path
> solution.
Unambiguity is _always_ preferred if security is a primary issue.
Anytime higher privileges are involved, that should be a high-priority
issue.
>
> Anne
> <snip sig stuff>
--
Bill
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
11-08-2008, 09:02 PM
Anne Wilson
Where is the file that sets aliases?
On Saturday 08 November 2008 20:38:43 William L. Maltby wrote:
> /etc/bashrc
>
> But be aware that root-specific ones are here on 5.x
>
> # grep alias .bashrc
> # User specific aliases and functions
> alias rm='rm -i'
> alias cp='cp -i'
> alias mv='mv -i'
I'm sorry, but I just can't understand why I can't find these
Anne
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
11-08-2008, 09:19 PM
"Mark A. Lewis"
Where is the file that sets aliases?
> I'm sorry, but I just can't understand why I can't find these
>
> Anne
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
[root@proxy ~]#
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
11-08-2008, 09:25 PM
"William L. Maltby"
Where is the file that sets aliases?
On Sat, 2008-11-08 at 22:02 +0000, Anne Wilson wrote:
> On Saturday 08 November 2008 20:38:43 William L. Maltby wrote:
> > /etc/bashrc
> >
> > But be aware that root-specific ones are here on 5.x
> >
> > # grep alias .bashrc
> > # User specific aliases and functions
> > alias rm='rm -i'
> > alias cp='cp -i'
> > alias mv='mv -i'
>
> I'm sorry, but I just can't understand why I can't find these
Corruption? Have you done an rpm --verify? Have you done an updatedb and
locate for rpmsave and rpmnew? Those are all I can think of.
Keep in mind that when you login, various config/init files are used by
bash, depending on normal operation or not. I've not examined all the
below, but nothing else catches my eye as "The Usual Suspects" (TM).
# ls -ld /etc/*prof* /etc/*bash*
drwxr-xr-x 2 root root 4096 Sep 17 06:00 /etc/bash_completion.d
-rw-r--r-- 1 root root 1437 Nov 28 2006 /etc/bashrc
drwxr-xr-x 2 root root 4096 Nov 10 2007 /etc/desktop-profiles
-rw-r--r-- 1 root root 937 Jan 31 2006 /etc/profile
drwxr-xr-x 2 root root 4096 Oct 13 16:16 /etc/profile.d
-rw-r--r-- 1 root root 32 Jan 3 2008 /etc/yumex.profiles.conf