| Author |
control Value of variable within multi-scripts
|
|
|
| Hi Friends,
I appreiciate your help on following:
I have 1st script that always runs one command.
command
I want modif it to follwing to add 2 conditions.
CHECK=NO
if [[ "$CHECK" = "YES" ]];then
command
fi
Now I want to create 2nd and 3rd scripts.
2nd scriptshould change the variable CHECK to YES. And that could be
used when we run the 1st script after running 1st separately.
3rd must reset the variable to original.
What I need is value of variable must remain same as set by 2nd script
for all sessions and retained by reboots, unless changed by 3rd
command.
Thanks and regards
| |
| Bill Marcum 2005-02-26, 5:53 pm |
| On 26 Feb 2005 05:03:32 -0800, shell
<sonchacan@hotmail.com> wrote:
>
> Now I want to create 2nd and 3rd scripts.
> 2nd scriptshould change the variable CHECK to YES. And that could be
> used when we run the 1st script after running 1st separately.
> 3rd must reset the variable to original.
>
> What I need is value of variable must remain same as set by 2nd script
> for all sessions and retained by reboots, unless changed by 3rd
> command.
>
2nd script:
echo "CHECK=YES" > checkthis
other scripts:
if [ -f checkthis ]; then . checkthis; fi
| |
|
| Thanks !!
It works!!
Bill Marcum wrote:
> On 26 Feb 2005 05:03:32 -0800, shell
> <sonchacan@hotmail.com> wrote:
be[vbcol=seagreen]
script[vbcol=seagreen]
> 2nd script:
> echo "CHECK=YES" > checkthis
> other scripts:
> if [ -f checkthis ]; then . checkthis; fi
| |
|
| Bill, Thanks much
It worked!!
Bill Marcum wrote:
> On 26 Feb 2005 05:03:32 -0800, shell
> <sonchacan@hotmail.com> wrote:
be[vbcol=seagreen]
script[vbcol=seagreen]
> 2nd script:
> echo "CHECK=YES" > checkthis
> other scripts:
> if [ -f checkthis ]; then . checkthis; fi
|
|
|
|