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 > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 10-25-2008, 09:10 PM
GI_Mike - Herman von Mandel
 
Default .bash_aliases setup

Greetings to the list!

Apparently I am missing something which is frustrating me a bit. I have a user account on a Debian Etch system which is needing some additional aliases and rather than muck around with .bashrc, I would rather the aliases be placed in ~/.bash_aliases.

The user created aliases within a ~/.bash_aliases file having a permission setting of 600. I then removed the comments from ~/.bashrc allowing for this file to be read.

After a source .bashrc, . ~/.bash_aliases, the user logging out and logging back in, and a complete reboot - this file is still not being read as aliases are coming back as unknown commands.

This should be a fairly straight forward and easy task to accomplish. Below are the snippets:

~/.bashrc
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

~/.bash_aliases
########################
# VNC Server aliases
########################

# create vnc server connection
vncsmall="vncserver -depth 24 -geometry 800x600 :1"
vncbig="vncserver -depth 24 -geometry 1024x768 :1"

# end vnc server connection
killvnc="vncserver -kill :1"

# check if vnc server is already running
runvnc="ps -A | grep vnc"

(Note: it is ok if he uses :1 - vncserver runs off a non-standard port and my iptables ensures he's the person using it via MAC)

Any ideas what I'm missing here?

Thanks!

Michael






--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 10-26-2008, 10:39 AM
"Anton Piatek"
 
Default .bash_aliases setup

2008/10/26 zhuzhixin <zhuzhixin@realss.com>:
> GI_Mike - Herman von Mandel wrote:
>> Greetings to the list!
>>
>> Apparently I am missing something which is frustrating me a bit. I have a user account on a Debian Etch system which is needing some additional aliases and rather than muck around with .bashrc, I would rather the aliases be placed in ~/.bash_aliases.
>>
>> The user created aliases within a ~/.bash_aliases file having a permission setting of 600. I then removed the comments from ~/.bashrc allowing for this file to be read.
>>
>> After a source .bashrc, . ~/.bash_aliases, the user logging out and logging back in, and a complete reboot - this file is still not being read as aliases are coming back as unknown commands.
>>
>> This should be a fairly straight forward and easy task to accomplish. Below are the snippets:
>>
>
> I think the file .bash_aliases need permission to execute. For when you
> open a terminal, it invoke ~/.bashrc which will invoke .bash_aliases.
> Hope this will be help.

I think it is a different issue - sourcing (the . command in bash)
does not require execute permission. The problem is that bash just
loads and runs the aliases file, so each alias line still needs to be
formatted like a bash command: e.g.
alias ls='ls --color'

Try putting "alias" at the beginning of each of your aliases to see if
that works, otherwise it is probably just setting env variables

Anton

--
Anton Piatek
email: anton@piatek.co.uk
blog/photos: http://www.strangeparty.com
pgp: [0xB307BAEF] (http://www.strangeparty.com/anton.asc)
fingerprint: 116A 5F01 1E5F 1ADE 78C6 EDB3 B9B6 E622 B307 BAEF

No trees were destroyed in the sending of this message, however, a
significant number of electrons were terribly inconvenienced.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 10-26-2008, 10:50 AM
Andrei Popescu
 
Default .bash_aliases setup

On Sun,26.Oct.08, 18:51:51, zhuzhixin wrote:

> I think the file .bash_aliases need permission to execute. For when you
> open a terminal, it invoke ~/.bashrc which will invoke .bash_aliases.
> Hope this will be help.

Sorry for being a nitpick, but you don't need execute permissions as
long as you only *source* the file (which is what was done here). The
OP's problem was due to the fact that he forgot to add the 'alias'
statement.

Regards,
Andrei
--
If you can't explain it simply, you don't understand it well enough.
(Albert Einstein)
 
Old 10-26-2008, 09:51 PM
zhuzhixin
 
Default .bash_aliases setup

GI_Mike - Herman von Mandel wrote:
> Greetings to the list!
>
> Apparently I am missing something which is frustrating me a bit. I have a user account on a Debian Etch system which is needing some additional aliases and rather than muck around with .bashrc, I would rather the aliases be placed in ~/.bash_aliases.
>
> The user created aliases within a ~/.bash_aliases file having a permission setting of 600. I then removed the comments from ~/.bashrc allowing for this file to be read.
>
> After a source .bashrc, . ~/.bash_aliases, the user logging out and logging back in, and a complete reboot - this file is still not being read as aliases are coming back as unknown commands.
>
> This should be a fairly straight forward and easy task to accomplish. Below are the snippets:
>

I think the file .bash_aliases need permission to execute. For when you
open a terminal, it invoke ~/.bashrc which will invoke .bash_aliases.
Hope this will be help.

> ~/.bashrc
> # Alias definitions.
> # You may want to put all your additions into a separate file like
> # ~/.bash_aliases, instead of adding them here directly.
> # See /usr/share/doc/bash-doc/examples in the bash-doc package.
>
> if [ -f ~/.bash_aliases ]; then
> . ~/.bash_aliases
> fi
>
> ~/.bash_aliases
> ########################
> # VNC Server aliases
> ########################
>
> # create vnc server connection
> vncsmall="vncserver -depth 24 -geometry 800x600 :1"
> vncbig="vncserver -depth 24 -geometry 1024x768 :1"
>
> # end vnc server connection
> killvnc="vncserver -kill :1"
>
> # check if vnc server is already running
> runvnc="ps -A | grep vnc"
>
> (Note: it is ok if he uses :1 - vncserver runs off a non-standard port and my iptables ensures he's the person using it via MAC)
>
> Any ideas what I'm missing here?
>
> Thanks!
>
> Michael
>
>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 10-26-2008, 11:41 PM
zhuzhixin
 
Default .bash_aliases setup

Andrei Popescu wrote:

> Sorry for being a nitpick, but you don't need execute permissions as
> long as you only *source* the file (which is what was done here). The
> OP's problem was due to the fact that he forgot to add the 'alias'
> statement.
>
> Regards,
> Andrei

Thanks very much:-)

Regards,
Zhu Zhixin


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 01:16 AM.

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