Hello,
I am having trouble with the syntax with a conditional statement in a BASH script involving multiple conditions. Any suggestions would be greatly appreciated!
if ; then
array=("${array}" "$dnNum" )
fi
i receive this error:
./testscript: ' (4 Replies)
Guys, Im trying to have a script that evaluates multiple conditions :
test.sh:
if
then
echo "host $1"
else
if
then
echo "host $1"
else
echo $1 not valid
exit 1
fi
when I do
./test.sh brazil1
I get: (4 Replies)
I have a script that runs on multiple servers. What I want to do is have the script do the following:
if $(hostname) is equal to server or server2
then
TO_DIR=go
else
TO_DIR=stop
fi
I have tried:
if
if ]
Server is hpux.
any ideas? (1 Reply)
Hi All,
I am new to shell scripting.
Can any one say what is wrong in this if statement, that uses multiple conditions
if
then
***************
else
if ( -z $pcs && "$night_time_calc" > "$night_time" )
then
********************************
... (4 Replies)
Deal Experts
I am working on a script to find a date which is 7 days older and follwoing is my approach
#!/bin/sh
Yr=`date +"%Y"`
Mn=`date +"%m"`
Md=28
Da=`date +"%d"`
echo $Yr
echo $Mn
echo $Da
var1=$Yr$Mn$Da
echo "before" $var1
if expr $Da > 7
then Da=`expr $Da - 7`... (3 Replies)
Hello,
I'm trying to put together a script that involves pulling data from a config file. I'm attempting to write an if statement to validate one of the pieces of data from the config file, but I think I'm fat fingering it somehow.
$config{VALUE} is being pulled from a config file but can only... (4 Replies)
Hello Unix-Forums!
It has been a long time since my last post, but finally I've got a new question:
I know in case you can use multiple patterns by
case $var in
a|b|c|ab)
and so on.
But how would I place an OR between
if ]
then
...
if ]
then
...
I want to execute the "..." if... (3 Replies)
Hi
I've been trying to get this to work but so far no luck.
#!/usr/bin/ksh
unset EXP
APP=$1
EXP=`sed -n "/${APP}/p" tIclrpt.out |awk '{print $7}'|sed '/^$/d'`
EXT=`sed -n "/${i}/p" ${SESLOG} |awk '{print $4}'|grep "${i}"`
EXEM=/path/to/fail
ACTI=/path/to/success
if ||
then... (10 Replies)
Fellas,
Am new to unix os/ and here the situation , I am trying to write multiple condition statement inside if but it throws me a error
here is my piece of code ,
if ] && ] && ]
then
commands
fi
error : line 15 : `
can someone please advise me how to fix it
Please use... (7 Replies)
I am analyzing one of the scripts written by another person.script is having multiple if conditions and everything are nested.The code is not formatted properly.Is there any way to identify in Unix to identify begin and end of a particular if block? (6 Replies)
Discussion started by: vamsi.valiveti
6 Replies
LEARN ABOUT CENTOS
setup
setup(1) setuptool setup(1)NAME
setup - A text mode system configuration tool
SYNOPSIS
setup
DESCRIPTION
The setuptool program (setup) is a front-end menu program for a group of other tools, mostly system-config-*-tui tools. The list of options
which it presents is assembled by scanning /etc/setuptool.d and /usr/share/setuptool/setuptool.d for files.
Each file in the directory should contain one or more lines of text. Each line contains from one to four fields which are separated by "|"
characters. In order, they are:
- the path to the binary to invoke (mandatory)
- the untranslated name of the application which should be displayed
(If unset, defaults to the path of the binary, but don't depend on that.)
- the gettext textdomain in which a translation of the name of the application can be found
(If unset, defaults to "setup".)
- the directory in which translations for the textdomain can be found
(If unset, defaults to "/usr/share/locale".)
If multiple entries with the same untranslated name exist, the one which was read FIRST takes precedence. Files are read in name collation
order.
EXAMPLE
A contrived example would create /etc/setuptool.d/00bogus with these contents:
/bin/ls --color; /bin/sleep 5|Example "ls" invocation.
or
/bin/ls --color; /bin/sleep 5|Give this help list|libc
to use one of libc's (not meaningful here, but) translatable messages.
Linux 2009-10-07 setup(1)