Why 'alias' cannot run by shell script?

From: wilson (wilsonidv_at_hotmail.com)
Date: 09/08/04


Date: 8 Sep 2004 03:02:52 -0700

Hello all,

I wrote a shell script below:

    #!/bin/bash
    ### MyScript ###

    alias m='mount /mnt/floppy'
    alias r='reboot'

After editing, I added the 'x' permission and it can be executed
correctly after I input ./MyScript.sh
But why the script was of no effect? I input 'm' or 'r', the error
message 'command not found' occurred.

Please correct me where I miswrote, thanks.



Relevant Pages

  • Re: Why alias cannot run by shell script?
    ... > alias r='reboot' ... > After editing, I added the 'x' permission and it can be executed ... Alexis ...
    (comp.unix.shell)
  • Re: So I click on this link...
    ... permission bits are preserved inside a .zip or a disk image. ... Safari can be set to expand those automatically. ... executable shell script appear on someone's computer. ... there is no auto-run mechanism for OS X, there's no way to trick Safari ...
    (uk.comp.sys.mac)
  • Re: Dynamic IPFW Rules
    ... >> Another option is to make a shell script or alias that drops expired ... > cleanup commits that you find), ... with "unsubscribe freebsd-security" in the body of the message ...
    (FreeBSD-Security)
  • Re: Using Several Alias Commands at Once
    ... >Can I do this with one big alias or some kind of batch file? ... You can do it with a shell script. ... Genuity Managed Services, a LevelCompany, Woburn, MA ...
    (comp.unix.questions)
  • Re: Dynamic IPFW Rules
    ... > Another option is to make a shell script or alias that drops expired ... with "unsubscribe freebsd-security" in the body of the message ...
    (FreeBSD-Security)

Loading