Re: source from within a script
From: Bob (bob_at_dont.spam.me)
Date: 06/13/04
- Next message: Ed Morton: "Re: compare scriptoutput with an outputfile"
- Previous message: d0x: "Re: generating an alias from whithin a script"
- In reply to: Bishara Sabbagh: "Re: source from within a script"
- Next in thread: Bishara Sabbagh: "Re: source from within a script"
- Reply: Bishara Sabbagh: "Re: source from within a script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 13 Jun 2004 14:38:59 GMT
On Sun, 13 Jun 2004 16:22:02 +0200, Bishara Sabbagh wrote:
> Hallo Bob,
> I tried your script and bash answers : bash: x: command not found
> that's why I appended the generated alias to .profile and tried to source
> it.
Be sure you source the "xxx" script. Use either of the following:
. xxx
source xxx
Don't execute the script:
./xxx # NO!
Also, in my script the first line ("#!/bin/bash") is not needed. I just
put it there by habbit.
<clip>
>> The following works for me...
>>
>> #!/bin/bash
>> echo -n "enter alias... "
>> read alias command
>> alias $alias="$command"
>>
>> I put the above in a scriped named xxx and used it like this:
>>
>> $ . xxx
>> enter alias... x ls -la
>> $ x
>>
>> the "x" command was properly aliased to "ls -la"
>>
>>
>>
- Next message: Ed Morton: "Re: compare scriptoutput with an outputfile"
- Previous message: d0x: "Re: generating an alias from whithin a script"
- In reply to: Bishara Sabbagh: "Re: source from within a script"
- Next in thread: Bishara Sabbagh: "Re: source from within a script"
- Reply: Bishara Sabbagh: "Re: source from within a script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|