"alias" has several meanings in Unix/Linux. I think you want a simple way to
execute a complex command. In Linux, you have two options for this. For
running ppp, you probably want to choose the second one.

1. Add an alias to your environment. If you use the bash shell, you do this
by adding a line to the file that bash reads on startup. This filname is
slightly system specific -- the general one (all users) is /etc/profile, and
user-specific ones include ~/.profile, ~.bashrc, and ~/.bash_login  (where
~/ means start from your home directory). Look in your home directory (with
the command "ls -a") and see which of these are present. Edit with any
editor you prefer. 

You add an alias to the environment with a line like this:

alias ll="ls -l"

(See the bash man page for more details.)

2. Create a shell program that executes the command. This is analogous to
writing a .BAT file under DOS/Windows. You do it like this:

#!/bin/sh
#enter commands here
ps -aux
# EOF

Save the file, make it executable ("chmod 777 filename" will do for an
example, replacing filename with its name), and enter its name as though it
were a command.

If you're used to DOS, one thing to remember is the need for the first line.
This line, beginning with the characters #! (sometimes called a "shebang"
line, a portmanteau of "sharp-bang", the common Unix names for the #!
characters), identifies the program that the system should use to execute
the rest of the file -- in this case, the basic shell sh . Commands can be
any legal lines for bash.

Oh ... where do they go? Anywhere in your PATH (enter "env" and look for
PATH= in the resulting output). For user-level scripts, one handy place is
/usr/local/bin; for root scripts, /usr/local/sbin  -- though some purists
object to putting scripts into directories "meant for" binaries (if there
are any on this list, I'll let them suggest alternative locations). BTW,
unless it's explicitly included (as ./), your current directory is NOT part
of your PATH, so to run something from that directory, you have to type
./programname instead of programname .

About ppp ... you may already have a shell script that will do what I
imagine you want. Many systems include /usr/sbin/ppp-on, a shell script that
will start a ppp connection once you replace a few dummy values (like the
phone number to call) with the real values for your setup. If you don't have
it, it's included in the PPP HowTo.

Sorry if this is more than you needed. I took your "absolutely nothing about
how aliases are done" comment literally.

At 05:56 AM 6/2/99 -0500, Austin G. Swinney wrote:
>Where do aliases go in linux?  And what is the syntax for the script? 
>If i know where they go, I can look there and copy the existing
>aliases.  NOTE:  I know absolutely nothing about how aliases are done. 
>My goal is to have aliases for the ppp dial-up process.

------------------------------------"Never tell me the odds!"---
Ray Olszewski                                        -- Han Solo
762 Garland Drive
Palo Alto, CA  94303-3603
650.328.4219 voice                              [EMAIL PROTECTED]        
----------------------------------------------------------------

Reply via email to