FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 11-08-2008, 05:57 PM
Anne Wilson
 
Default Where is the file that sets aliases?

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
 
Old 11-08-2008, 06:00 PM
MHR
 
Default 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
 
Old 11-08-2008, 06:00 PM
Ignacio Vazquez-Abrams
 
Default 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
 
Old 11-08-2008, 06:39 PM
Anne Wilson
 
Default 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
 
Old 11-08-2008, 06:43 PM
Anne Wilson
 
Default 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
 
Old 11-08-2008, 07:09 PM
Ignacio Vazquez-Abrams
 
Default 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
 
Old 11-08-2008, 07:38 PM
"William L. Maltby"
 
Default 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
 
Old 11-08-2008, 09:02 PM
Anne Wilson
 
Default 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
 
Old 11-08-2008, 09:19 PM
"Mark A. Lewis"
 
Default Where is the file that sets aliases?

> I'm sorry, but I just can't understand why I can't find these
>
> Anne

[root@proxy ~]# pwd
/root
[root@proxy ~]# cat .bashrc
# .bashrc

# User specific aliases and functions

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
 
Old 11-08-2008, 09:25 PM
"William L. Maltby"
 
Default 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

Local mods somewhere in the past? Missed update?

# lsb_release
LSB
Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch

# cat /etc/redhat-release
CentOS release 5.2 (Final)

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

]# grep -irl alias /etc/*prof* /etc/*bash*
/etc/profile
/etc/profile.d/colorls.csh
/etc/profile.d/vim.csh
/etc/profile.d/colorls.sh
/etc/profile.d/nvidia.sh
/etc/profile.d/vim.sh
/etc/profile.d/which-2.sh
/etc/profile.d/nvidia.csh
/etc/bashrc

In /etc/passwd, add the "-x" flag to the end of the root line and you
should see all executed commands.

>
> Anne
> <snip sig stuff>

HTH
--
Bill

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 10:08 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org