[ale] Bash scripts for idiots...

Jacob Langseth jwl at pobox.com
Fri Nov 5 23:33:03 EST 1999


Benjamin Scherrey scribed:
> I appreciate the idea but I really want to do more than just that.
> Only, I need it to run within the current environment and make any
> changes persist within my session. An alias can't do it all. I can't
> believe this isn't a very simple basic thing to do (like a DOS batch
> file).

There is.  If you need more functionality than
you'd feel comfortable fitting into an alias,
define it as a function.  Ie

your_script:
    work ()
    {
        cd ~/develop/src
        dir
    }

Then, type
    . ./your_script
    (or 'source ./your_script')

This will cause the shell to interpret the
commands w/in the current shell, resulting
in a work() definition which does pretty
much whatever you need it to.

-- 
Jacob Langseth <jwl at pobox.com>






More information about the Ale mailing list