12-02-2018
Moderator's Comments:
|
|
This is a duplicate f the problem raised in the thread Error code with if statement. Please continue any discussion on this topic there.
This thread is closed.
|
|
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Please help develop script for below requirement
-------Sample file-------------------------------
HSVSHOSTRECON 20090115011817BP
DARMAR60064966247003504720000000000000000000066626000000000000133000003D003463001332 ... (14 Replies)
Discussion started by: niraj_bhatt
14 Replies
2. Shell Programming and Scripting
This is the code:
while test 1 -eq 1
do
read a
$a
if test $a = stop
then
break
fi
done
I read a command on every loop an execute it.
I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test.
For example echo hello.
Now the... (1 Reply)
Discussion started by: Max89
1 Replies
3. Shell Programming and Scripting
How to check weather a string is like test* or test* ot *test* in if condition (5 Replies)
Discussion started by: johnjerome
5 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I have written a script to compare 2 string values.. below is the script.. it throws an error - ./compare_str.sh: test: amount1|amount2: unknown operator..
as both are string values, I am using a = operator in the test command.
can some one help me figure out where the issue is?... (11 Replies)
Discussion started by: Vijay81
11 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am trying to write a small script that validates if there exist files that start with a pattern in a given directory. Below is the piece of my script:
#!/usr/bin/ksh
BTFDIR=/opt/ships/temp
if
then
echo 'found'
else
echo 'not found'
fi
When I run this... (2 Replies)
Discussion started by: snvniranjanrao
2 Replies
6. Shell Programming and Scripting
Hi,
I have the following script under bash
if ; then
echo File $file_name Not Found
else
echo File $file_name Found
fi
I get the message
even the file is found; there is only one file with that name in the directory
I can't figure... (4 Replies)
Discussion started by: f_o_555
4 Replies
7. Shell Programming and Scripting
I want to make a script that check for the argument passed to it and generates an error in case any character/string argument passed to it.
I am using below code, but its not working. can anyone help.
#!/bin/bash
if ]; then
echo 'An integer argument is passed to the script hence... (3 Replies)
Discussion started by: mukulverma2408
3 Replies
8. Shell Programming and Scripting
Hi All the Helpers!
I have a text file which looks like input.txt.I would request to please suggest me how can I make this file look like output.txt
input.txt
VOP 111 0 1 2
DEM 111 0 222 333 444 555
DEM 879 888 987 888 989
DEM 879 888 987 888 989
VOP 118 0 12 3 6... (7 Replies)
Discussion started by: Indra2011
7 Replies
9. Shell Programming and Scripting
I have a following script to evaluate if file exist in the directory and then archive it.
#!/bin/bash
#master directory
scriptdir="/flex/sh/interfaces" #change this path only - all other paths are connected with it
filedir="/flex/interfaces" #change this path only - all other paths are... (3 Replies)
Discussion started by: viallos
3 Replies
10. Shell Programming and Scripting
EDIT: Resolved
Resolved by changing the first line to bash rather than csh, does bash and csh treat the brackets differently?
Hi all,
I'm doing to some basic stuff to teach myself "if"
I've written the following:
#!/bin/csh
echo "This script checks for the test file"
... (1 Reply)
Discussion started by: Meshuggener
1 Replies