Hi
I have a script like
read i
if
then
echo bingo
fi
I want to enter the if block if i is equal to *
The same doesn't happen , when I input * the script fails with error "[: too many arguments"
I know it is very basic , but still Could any one help me out with the issue
... (3 Replies)
hello
I want to do a pattern match for string in the if statement, but I am not sure how to use regex inside the if statement.
I am looking for something like this:
if {2,3} ]; then
.....
....
...
fi (7 Replies)
Hi All,
I have a status.txt file which contains following three files.
1.xml
2.xml
3.xml
Now i have written a shell script 1.sh which contains the following
cat status.txt | while read filename
do
echo $filename
case "$filename" in
xml)
echo "running 1.xml"
;;
... (3 Replies)
I want to do this:
Ex 1:
case $answer in
1|2|3|4|5) echo $answer;;
x) break;;
*) echo "Invalid selection. Try again.";;
esac
But I need the part "1|2|3|4|5" to be fetched from a variable, like so:
Ex 2:
case $answer in
$cases) echo $answer;;
x) break;;
*) echo "Invalid... (2 Replies)
i want to select a variable created and use it in a if statement, but not getting the desired results
LINE='device for 0101a01: lpd://172.25.41.111:515'
prt=`echo $LINE | awk '{print $3 }' | cut -c 1-7`
echo $prt
My if statement to select just what i want..
IFS=$":"
while read prt... (11 Replies)
Hi All,
I am trying to alter all lines between EXEC SQL and END-EXEC that have an INCLUDE in them.
The following code
search="INCLUDE "
cp -f ${WORK}/$file.in ${WORK}/$file.wrk2
for item in `echo $search `; do
> ${WORK}/$file.wrk1
awk -vITEM="$item" '{
if ( $0... (3 Replies)
I'm trying to create what (should be) a simple bash script that will pull computer name and use that info to bind to one of three servers. Is there any way to do this without having a text file with the names of the servers and associated computer names? (5 Replies)
All,
I am trying to write a script which will match the statement from one log file and then proceed for other commands mention in the script.
for my application, backup is schedule to run every day at particular time and creats a log file "/var/adm/backuplog".
if backup completes then... (2 Replies)
Hi,
I am tasked to modify soem script and I come accross a line which I dont fully understand. I tried searching online but I couldnt get a good explanation on it.
Here it the part of the code:
PAY_RT=`cat $TEMPFILE | cut -f2 -d","`
if ;
then
PAY_RT=R
fi
What is... (3 Replies)
I have multiple requirements to run data extracts (with the same basic requriement / resulsts) however the parameters of the extracts change with each request. To help make life easier I am writing a script where the parameters for the specific request are set at the start and then used as needed.... (6 Replies)