Re: newb commandline scripting and c/c++
Re: newb commandline scripting and c/c++
- Subject: Re: newb commandline scripting and c/c++
- From: "Brett George" <email@hidden>
- Date: Sun, 24 Aug 2008 09:39:03 -0700
On Sun, 24 Aug 2008 08:38:54 -0700
Steve <email@hidden> wrote:
Again forgive me if this is the wrong list.
I looked over all of the mailing list and there isn't one for:
newbie shell scripting
beginner commandline c/c++
I opened a new file with vi calling it ll (LL) and I put the
following line in it:
ls -al
I then
chmod +x ll
sudo mv ll /usr/bin
it worked as I thought it would.
I then opened a new file with vi calling it myc and I put the
following line in it:
cd /Developer/sandbox/myc
I then
chmod +x myc
sudo mv myc /usr/bin
however when I myc nothing happens, literally, no error, and no
change in directory no matter where I am.
So 2 questions:
What dumb thing am I over looking here or is this a mac thing?
AND
I use to get into my .profile file on an AIX machine and I used
alias ll 'ls -al'
alias myc 'cd /Developer/sandbox/myc'
Is there a similar way to use aliases on the mac so I can have
typing short-cuts when on the commandline?
Steve -New to Mac
PS...I love this machine, I just want to learn to code on it and I'm
starting from the ground/commandline up!
Currently I'm using WROX Begiining Linux Programming
So any beginning mac programming site's or books or other info is
greatly appreciated.
This is a good place to start:
http://developer.apple.com/documentation/OpenSource/Conceptual/ShellScripting/Introduction/chapter_1_section_1.html
A common mistake is forgetting the "shebang":
http://en.wikipedia.org/wiki/Shebang_(Unix)
Also, you dont need to copy to your /usr/bin directory, just run it
from the working directory by specifying the path of the file you are
running: ie "./ll.sh"
Brett
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden