LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   alias with cd in shell (https://www.linuxquestions.org/questions/linux-newbie-8/alias-with-cd-in-shell-443629/)

mtdew3q 05-10-2006 07:29 PM

alias with cd in shell
 
hi-

i cant seem to get this one to work:
alias b="cd /home/thirdshift/bin"
but
alias 11="ls -l"
works?

i just created a script to automate some commands and i need
an alias to point this bin directory because that is where
i am going to dump all my shell scripts.

where is .alias located? maybe it isnt created yet.
i see .bashrc

i want to automate some things so i can type less in the shells.

thanks,
jim

mtdew3q 05-10-2006 08:42 PM

hi-
i thought a screen dump might help.

thirdshift@linux:/> alias b = "cd /home/thirdshift/bin"
bash: alias: b: not found
bash: alias: =: not found
bash: alias: cd /home/thirdshift/bin: not found
thirdshift@linux:/>

thanks very much,
jim

chrism01 05-10-2006 09:49 PM

It works for if you DON'T have spaces around '=' ie
alias b="cd /home/thirdshift/bin"
is fine
alias b = "cd /home/thirdshift/bin"
gives errors. It's in the bash manual somewhere...

mtdew3q 05-10-2006 11:55 PM

re: alias with spaces
 
i just figured it out. thanks for replying.
that was exactly it! i need to get my hands on
some manuals. i cant stand to read the screen on computer
with text that goes on forever with a white background.
i also learned another thing i was doing wrong was
not calling exec to execute a non bash command.

the more i use suse linux the more i like it.
it is a good hobby.

thanks chris,
jim

Emmanuel_uk 05-11-2006 02:42 AM

see lq bookmarks
general newbie guides: rute and newbie admin guide
search for bash, in LQB for bash w/w tutorial/guide
I have put a link to at least one

muha 05-11-2006 02:47 AM

@mtdew3q: you could also change your konsole :D ~> (in konsole): settings, schema, green on black.
Looks like over here: http://spinink.net/suse-for-windows-users/

mtdew3q 05-11-2006 03:56 PM

Thanks Emmanuel & Muha
for the tips. Now i am ready to do some reading.
The links and the colors are going to come in really handy.

have a good weekend,
jim


All times are GMT -5. The time now is 01:12 AM.