BASH alias not working...

Magnus Therning magnus at therning.org
Tue Jun 21 06:41:30 UTC 2005


On Mon, Jun 20, 2005 at 09:25:31PM -0400, Matthew S-H wrote:
>
>On Jun 20, 2005, at 8:06 PM, Byron Saltysiak wrote:
>
>>Hmm... my first inclination is to break this complex logic into a
>>shell script. I have a /bin directory in my /home directory which I
>>put personal scripts in. Just add that directory to your path.
>>You could put this whole thing into a script called something like
>>choose_to_edit.sh and make sure that script is executable.
>>I'd also put all the commands you want to run on separate lines and
>>check the exit value of the important ones with $? instead of putting
>>them all on one line with &&.
>>Making a standalone script and putting the commands on different lines
>>will make it easier to debug. Also, if you have the script on your
>>path I know you can tab complete it, not sure about aliases.
>
>Thank you very much :).  After implementing this idea of making it  all into 
>scripts, it works wonderfully!

Another option would be to make it a function.

Here are the "rules" I use to determine at what level I implement shell
stuff:

 alias - one-line stuff, e.g. ll='ls -i'
 function - one-line stuff that takes arguments, sometimes slightly
            longer things, 2-5 lines
 script - things I consider to be programs rather than 'shortcuts'

/M

-- 
Magnus Therning                    (OpenPGP: 0xAB4DFBA4)
magnus at therning.org
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

The second oldest profession is book keeping.
     -- Craig Burton
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050621/b77f0a6b/attachment.pgp>


More information about the ubuntu-users mailing list