PDA

View Full Version : [ubuntu] alias problem



tgroves10
August 25th, 2011, 04:42 PM
i just installed ubuntu and to execute i have to type ./a.out and i would like to be able to do it with just a.out. i used gedit to edit .bashrc. when in .bashrc i added (alias a.out='./a.out')
without the parenthesis then i saved it exited out and ran touch .bashrc but when i use the command a.out it doesnt work.....can anyone help please

CharlesA
August 25th, 2011, 04:46 PM
You'd have to use the full pah in the alias.

tgroves10
August 25th, 2011, 05:03 PM
so what do i need to do to be able to type a.out in the command line and it be able to work

fdrake
August 25th, 2011, 05:06 PM
where is the a.out stored?

bodhi.zazen
August 25th, 2011, 05:11 PM
so what do i need to do to be able to type a.out in the command line and it be able to work

Easiest way is to put a.out in ~/bin

log out and back in ;)

If you want an alias you need to use the full path to a.out

alias a.out='/home/you/some_directory/a.out'

CharlesA
August 25th, 2011, 05:16 PM
easiest way is to put a.out in ~/bin

log out and back in ;)


+1 :)