Can I "export" an alias to the SHELL that invoked a script?

Posted by RonK on Super User See other posts from Super User or by RonK
Published on 2012-07-11T08:19:30Z Indexed on 2012/07/11 9:17 UTC
Read the original article Hit count: 256

Filed under:
|
|

I'm trying to write a utility script that defines certain aliases.
My SHELL is tcsh (can't change that).

I tried the following

#!/bin/tcsh
alias log 'less ~/logs/log.date '+%Y%m%d'''

Then I run it like this:

> ./myscript
> log

The output I get is: log: Command not found.

Naturally if I run it like this:
> source myscript
> log

Everything is fine.

Any way to do it without specifying source ...?

© Super User or respective owner

Related posts about shell-script

Related posts about alias