How to access the bash variables in csh

Hi,

I am having a primary script which is Bash based. I am calling a csh script from it.

Now, their are some variables defined in my bash script which i need in csh.
I am unable to do so. Is it possible ?

export the variables

1 Like

Hi

$ cat test.sh
#!/bin/bash

export VAR="welcome"

echo "In Bash: $VAR"

#calling a csh script
test2.sh
$ cat test2.sh
#!/bin/csh

echo "In csh: $VAR"

On running the script:

$ ./test.sh
In Bash: welcome
In csh: welcome

Guru.

1 Like