Combine if statements [closed]
up vote
-1
down vote
favorite
#select the snapshot or release
if [ "$SELECT_SNAP_OR_REL_VERSION" == "Snapshots" ]
then
$SELECT_SNAPSHOT_VERSION
echo "Snapshot Selected"
elif [ "$SELECT_SNAP_OR_REL_VERSION" == "Releases" ]
then
$SELECT_RELEASE_VERSION
echo "Release Selected"
else
echo "No Selection"
fi
#deploy the artifact to selected server
if [ "$Server_Selection" == "192.168.94.139" ]
then
selectDevSnap;
elif [ "$Server_Selection" == "192.168.94.140" ]
then
selectProdRel
else
echo "Error"
fi
I need to combine above two scripts. If selected version is "Snapshots" then "SELECT SNAPSHOT VERSION", then if "SERVER SELECTION=192.168.94.139" then "selectDevSnap". Argument should be like this.
I tried this,
#select the snapshot or release
if [ "$SELECT_SNAP_OR_REL_VERSION" == "Snapshots" ]
then
$SELECT_SNAPSHOT_VERSION
echo "Snapshot Selected"
else
if [ "$Server_Selection" == "192.168.94.139" ]
then
selectDevSnap;
else
echo "Error"
fi
fi
bash shell
closed as unclear what you're asking by Kusalananda, Jesse_b, JigglyNaga, mosvy, G-Man Nov 21 at 17:15
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
-1
down vote
favorite
#select the snapshot or release
if [ "$SELECT_SNAP_OR_REL_VERSION" == "Snapshots" ]
then
$SELECT_SNAPSHOT_VERSION
echo "Snapshot Selected"
elif [ "$SELECT_SNAP_OR_REL_VERSION" == "Releases" ]
then
$SELECT_RELEASE_VERSION
echo "Release Selected"
else
echo "No Selection"
fi
#deploy the artifact to selected server
if [ "$Server_Selection" == "192.168.94.139" ]
then
selectDevSnap;
elif [ "$Server_Selection" == "192.168.94.140" ]
then
selectProdRel
else
echo "Error"
fi
I need to combine above two scripts. If selected version is "Snapshots" then "SELECT SNAPSHOT VERSION", then if "SERVER SELECTION=192.168.94.139" then "selectDevSnap". Argument should be like this.
I tried this,
#select the snapshot or release
if [ "$SELECT_SNAP_OR_REL_VERSION" == "Snapshots" ]
then
$SELECT_SNAPSHOT_VERSION
echo "Snapshot Selected"
else
if [ "$Server_Selection" == "192.168.94.139" ]
then
selectDevSnap;
else
echo "Error"
fi
fi
bash shell
closed as unclear what you're asking by Kusalananda, Jesse_b, JigglyNaga, mosvy, G-Man Nov 21 at 17:15
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
You wrote "Argument should be like this.
", but I can't see any arguments. Please show the expected inputs and outputs of your script, and indicate which bit is not working as you expected.
– JigglyNaga
Nov 21 at 15:57
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
#select the snapshot or release
if [ "$SELECT_SNAP_OR_REL_VERSION" == "Snapshots" ]
then
$SELECT_SNAPSHOT_VERSION
echo "Snapshot Selected"
elif [ "$SELECT_SNAP_OR_REL_VERSION" == "Releases" ]
then
$SELECT_RELEASE_VERSION
echo "Release Selected"
else
echo "No Selection"
fi
#deploy the artifact to selected server
if [ "$Server_Selection" == "192.168.94.139" ]
then
selectDevSnap;
elif [ "$Server_Selection" == "192.168.94.140" ]
then
selectProdRel
else
echo "Error"
fi
I need to combine above two scripts. If selected version is "Snapshots" then "SELECT SNAPSHOT VERSION", then if "SERVER SELECTION=192.168.94.139" then "selectDevSnap". Argument should be like this.
I tried this,
#select the snapshot or release
if [ "$SELECT_SNAP_OR_REL_VERSION" == "Snapshots" ]
then
$SELECT_SNAPSHOT_VERSION
echo "Snapshot Selected"
else
if [ "$Server_Selection" == "192.168.94.139" ]
then
selectDevSnap;
else
echo "Error"
fi
fi
bash shell
#select the snapshot or release
if [ "$SELECT_SNAP_OR_REL_VERSION" == "Snapshots" ]
then
$SELECT_SNAPSHOT_VERSION
echo "Snapshot Selected"
elif [ "$SELECT_SNAP_OR_REL_VERSION" == "Releases" ]
then
$SELECT_RELEASE_VERSION
echo "Release Selected"
else
echo "No Selection"
fi
#deploy the artifact to selected server
if [ "$Server_Selection" == "192.168.94.139" ]
then
selectDevSnap;
elif [ "$Server_Selection" == "192.168.94.140" ]
then
selectProdRel
else
echo "Error"
fi
I need to combine above two scripts. If selected version is "Snapshots" then "SELECT SNAPSHOT VERSION", then if "SERVER SELECTION=192.168.94.139" then "selectDevSnap". Argument should be like this.
I tried this,
#select the snapshot or release
if [ "$SELECT_SNAP_OR_REL_VERSION" == "Snapshots" ]
then
$SELECT_SNAPSHOT_VERSION
echo "Snapshot Selected"
else
if [ "$Server_Selection" == "192.168.94.139" ]
then
selectDevSnap;
else
echo "Error"
fi
fi
bash shell
bash shell
edited Nov 23 at 3:03
asked Nov 21 at 4:36
Janith
82
82
closed as unclear what you're asking by Kusalananda, Jesse_b, JigglyNaga, mosvy, G-Man Nov 21 at 17:15
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as unclear what you're asking by Kusalananda, Jesse_b, JigglyNaga, mosvy, G-Man Nov 21 at 17:15
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
You wrote "Argument should be like this.
", but I can't see any arguments. Please show the expected inputs and outputs of your script, and indicate which bit is not working as you expected.
– JigglyNaga
Nov 21 at 15:57
add a comment |
You wrote "Argument should be like this.
", but I can't see any arguments. Please show the expected inputs and outputs of your script, and indicate which bit is not working as you expected.
– JigglyNaga
Nov 21 at 15:57
You wrote "
Argument should be like this.
", but I can't see any arguments. Please show the expected inputs and outputs of your script, and indicate which bit is not working as you expected.– JigglyNaga
Nov 21 at 15:57
You wrote "
Argument should be like this.
", but I can't see any arguments. Please show the expected inputs and outputs of your script, and indicate which bit is not working as you expected.– JigglyNaga
Nov 21 at 15:57
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
You wrote "
Argument should be like this.
", but I can't see any arguments. Please show the expected inputs and outputs of your script, and indicate which bit is not working as you expected.– JigglyNaga
Nov 21 at 15:57