Quantcast
Channel: how to source csh script from bash environment? - Ask Ubuntu
Viewing all articles
Browse latest Browse all 4

Answer by Shane for how to source csh script from bash environment?

$
0
0

I don't know csh but I have a similar requirement for ksh. My hack solution was to

eval source <(ksh -c ". /path/to/my_script.kshenv|sort)

I ran into issues with quoting and ended up putting in some grep patterns after the env to remove environment variables that I didn't want carried over but it kinda worked.

I found another useful bit here:

https://www.theunixschool.com/2010/07/how-to-access-child-shell-env-variable.html

This little bit of sed creates properly quoted export commands:

sed 's/^/export /;s/=/=\"/;s/$/\"/'

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>