Printing from Shell Script

My print alias that works fine from the command line does not function from withn a shell script. Instead of actually performing the printing, it instead writes out the name of the file I'm trying to print. Does anyone know why? Much Thanks.

Because aliases don't work in scripts. Aliases only work for interactive users.

Functions will though, if your shell has them. What is your shell?

Korn Shell

Try a function then.

function asdf
{
        echo $1 $2
}

asdf a b
1 Like