LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-10-2006, 07:29 PM   #1
mtdew3q
Member
 
Registered: Mar 2006
Location: upstate NY
Distribution: fedora 15
Posts: 208

Rep: Reputation: 17
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
 
Old 05-10-2006, 08:42 PM   #2
mtdew3q
Member
 
Registered: Mar 2006
Location: upstate NY
Distribution: fedora 15
Posts: 208

Original Poster
Rep: Reputation: 17
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
 
Old 05-10-2006, 09:49 PM   #3
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
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...
 
Old 05-10-2006, 11:55 PM   #4
mtdew3q
Member
 
Registered: Mar 2006
Location: upstate NY
Distribution: fedora 15
Posts: 208

Original Poster
Rep: Reputation: 17
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
 
Old 05-11-2006, 02:42 AM   #5
Emmanuel_uk
Senior Member
 
Registered: Nov 2004
Distribution: Mandriva mostly, vector 5.1, tried many.Suse gone from HD because bad Novell/Zinblows agreement
Posts: 1,604

Rep: Reputation: 47
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
 
Old 05-11-2006, 02:47 AM   #6
muha
Member
 
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451

Rep: Reputation: 37
@mtdew3q: you could also change your konsole ~> (in konsole): settings, schema, green on black.
Looks like over here: http://spinink.net/suse-for-windows-users/
 
Old 05-11-2006, 03:56 PM   #7
mtdew3q
Member
 
Registered: Mar 2006
Location: upstate NY
Distribution: fedora 15
Posts: 208

Original Poster
Rep: Reputation: 17
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alias or shell script to confirm 'exit' commands from a shell rose_bud4201 Programming 2 03-08-2006 02:34 PM
alias does not work in shell script mannahazarika Programming 9 01-20-2006 01:56 PM
Delay in shell script or alias jeopardyracing Linux - Newbie 6 09-21-2004 08:07 PM
alias in bash shell wincrk Linux - General 12 07-20-2004 12:35 PM
RH9, alias and tcsh shell jeguilloal Red Hat 1 11-26-2003 01:42 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration