views:

18

answers:

1

Good morning,

In zshell I have an alias as follows:

alias foo='echo FooBar!'

Which of course works fine.

I have a function wherein I'm trying to actually 'execute' the alias, where it doesn't.

foo_fun () {
    echo "About to foo!"
    `$foo`
    $foo
    eval $foo
    eval `$foo`
    echo "Just food...wait what?"
}

I'm having a bear of a time coming up with reasonable search terms for this. Any thoughts?

I also tried:

"$foo"

which yields a 'permission denied' message. (wut?)

TIA o/

+1  A: 

Aliases aren't variables, you treat them like normal commands. Just run 'foo'. Most likely $foo was undefined and returned nothing; "" will give you "permission denied" too

Michael Mrozek
Wow. Everything but the simplest. It's gonna be one of those days. Thanks o/
Michael Wilson