Send output from one script to another script

 

=======================================================
#Send output from one script to another script
=======================================================


[prabhucloudxlab@cxln4 ~]$ cat>hello.sh
#! bin/bash
echo "enter name is:"
read name
export name
job=$1
echo "enter job is: $job"
export job

sh 2ndscript.sh



[prabhucloudxlab@cxln4 ~]$ cat>2ndscript.sh
#! bin/bash
echo "the name from helloscript is:$name"
echo "the job from helloscript is:$job"


Output:
[prabhucloudxlab@cxln4 ~]$ sh hello.sh QA_engineer
enter name is:
hari_taraka_prabhu
enter job is: QA_engineer
the name from helloscript is:hari_taraka_prabhu
the job from helloscript is:QA_engineer



#Note: exported hello.sh output to 2ndscript.sh