[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scripts one after the other
From: |
Val Krem |
Subject: |
scripts one after the other |
Date: |
Sat, 26 Mar 2016 01:28:56 +0000 (UTC) |
I have two scripts(job1.sh and job2.sh) that are executed one after the other.
Job2.sh depends on the output of job1.sh. If the output of job1.sh is correct
then I execute job2.sh.
Both scrips do have common variables (var1 , var2 and var3) and also some
input and output folder name defined.
At the present I have defined the variables and folders path in both scripts.
Instead of this, is it possible to combine the two scripts in one so that I
can define the varietals at one spot. It would be less prone to error.
The problem that I have now is that I want to see the output of job1 script
before preceding the next process. I want insert a question if I want to
proceed to the next execution. If I say no let the script stop processing
otherwise continue to the next command.
##################################
#!/bin/bash
f1=/test/folder1
f2=/test/folder2
f3=/test/folder3
echo " TEST "
echo "What is the data name? "
read var1
echo " "
echo "The data name that you entered is, $var1"
echo " "
echo "What date was the data collected in the format of 01/12/2003"
read date
echo " "
echo "The date is, $date"
echo " "
The above variables are common to both scripts.
unzip ${df1}/'var.zip' -d ${f1}
hashE ${f1}/${var1}_filename.csv> ${f2}/output.txt
head ${f2}/output.txt; tail ${f2}/output.txt
# I want insert ask a question would like to continue?
read response
x1=Yes
x2=No
if [ $response -eq $x1 ]
if yes run the next step
else exit
?????
any hep please
- scripts one after the other,
Val Krem <=