1

Script 1:

#!bin/csh
set option = $<

switch ($option) case 1 : ... breaksw case 2 : ... breaksw endsw


script 2 :

#!/bin/bash

Now how to access "option: variable defined in script 1 , so that based on option content , i would write if-elseif condition ?

muru
  • 72,889
Aakash
  • 31
  • If your two scripts can be launched script1 | script2 then echo in the first and read in the second. If it cannot be envisaged then I believe that setting $option as an environment variable (setenv) in the first script, will be the most easy way to follow. – MC68020 Aug 17 '20 at 09:02
  • What is the relationship between the two scripts? Does one call the other, start it asynchronously, pipe to it? Do they even run at the same time, or on the same machine? – Paul_Pedant Aug 17 '20 at 09:24
  • Call script2 from inside script1 and place the $option shell variable on the scrpt2's argument list. – Rakesh Sharma Aug 17 '20 at 11:17

0 Answers0