The Computer Oracle

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

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Romantic Lands Beckon

--

Chapters
00:00 Can I &Quot;Export&Quot; An Alias To The Shell That Invoked A Script?
00:33 Accepted Answer Score 35
00:51 Thank you

--

Full question
https://superuser.com/questions/447487/c...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#shellscript #alias #tcsh

#avk47



ACCEPTED ANSWER

Score 35


You can't. By running your script you execute a new shell. Aliases will not be seen by the parent process.

The only way as pointed out is using source so that the current shell processes your script file (without starting a new process).