02-24-2012
Remove one of the equal to sign and try [ $Test1 = 'Dummy' ]. Also which OS your using..?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi,
pls could you help me with one program in KSH ( i have sunOS).
I need to create an If clause, that prints an error message and filenames, when in a directory are found some files of null size (find . -type f -size 0 ).
thanks (3 Replies)
Discussion started by: palmer18
3 Replies
2. Shell Programming and Scripting
if test $b -ne
then
echo "\n\n\n\tPassword reset has been done successfully"
else
echo "\n\n\n\tAn error occurred"
fi
i want to check whether $b is non-numeric so how to do that? (3 Replies)
Discussion started by: sachin.gangadha
3 Replies
3. Shell Programming and Scripting
Hi
I am writing a bash script and would like to check is a variable contains a . or not
ex.
a=102 output ok
a=1.02 output not ok
Many thanks, (3 Replies)
Discussion started by: gekkos
3 Replies
4. Shell Programming and Scripting
Hello,
I want to checkl whether my file has text in it or not.
if ; then
...
if ; then
...
But none of these work
Can someone help me?
---------- Post updated at 09:00 AM ---------- Previous update was at 08:55 AM ----------
The code-tags caused an displayerror,... (5 Replies)
Discussion started by: ABE2202
5 Replies
5. Shell Programming and Scripting
Hi all,
What is the simplest way to setting a variable to $1 if it exists ?
If I go with name=${"$1":-abc}, bash complains "bad substitution",
So I use
name="$1"
name=${name:-abc}
But is there a way to fix this "bad substitution" ?
Thanks! (2 Replies)
Discussion started by: qiulang
2 Replies
6. Shell Programming and Scripting
I have seen many posts for this sort of problem but I just did not know how to use it for my issue. A number is assigned to a variable and I wanted to check if it is a zero or non zero.
Example of my numbers are below:
000000000000000000000000000000000000000000000000... (8 Replies)
Discussion started by: soujiv
8 Replies
7. Shell Programming and Scripting
#!/bin/sh
echo "Running Script to capture ORACLE Erros"
# Change Directory to the actual logs path
cd /home/nv8510/lognew
err_var=`grep -in "ORA-" *`
if then
echo "THESE ARE THE ORACLE ERROR OCCURED"
echo "$err_var"
echo... (7 Replies)
Discussion started by: neeraj617
7 Replies
8. Shell Programming and Scripting
Hi all,
I want to use a variable inside my sql query and below is my script:
#!/bin/ksh
export b="abcd"
a=`sqlplus -s abc/def@ghi <<++
set heading off;
set feedback off;
select xxx from mytable where clmn_nm='$b';
exit;
++`
echo $a
But the output i get is below:
$>... (4 Replies)
Discussion started by: Jayaraman
4 Replies
9. Shell Programming and Scripting
I have a script /root/asas with following contents.
#!/bin/bash
ha=`cat /etc/passwd | grep sandra`
if ; then
echo "Sandra is in /etc/passwd"
echo "variable ha is $ha"
else
echo "Sandra is NOT in /etc/passwd"
echo "variable ha is $ha"
fi
What... (3 Replies)
Discussion started by: anil510
3 Replies
10. Shell Programming and Scripting
Hi people,
I would like to start a review of my config variable to check whether they have been changed and if not then there is only an echo. If they have been changed to my other commands are executed.
I hope you can help me.
with best regards
JPad
edit:
here my code
if ;... (8 Replies)
Discussion started by: JPad
8 Replies
LEARN ABOUT CENTOS
ocf_pacemaker_dummy
OCF_PACEMAKER_DUMMY(7) Pacemaker Configuration OCF_PACEMAKER_DUMMY(7)
NAME
ocf_pacemaker_Dummy - Example stateless resource agent
SYNOPSIS
OCF_RESKEY_state=string [OCF_RESKEY_fake=string] OCF_RESKEY_op_sleep=string Dummy [start | stop | monitor | reload | migrate_to |
migrate_from | validate-all | meta-data]
DESCRIPTION
This is a Dummy Resource Agent. It does absolutely nothing except keep track of whether its running or not. Its purpose in life is for
testing and to serve as a template for RA writers. NB: Please pay attention to the timeouts specified in the actions section below. They
should be meaningful for the kind of resource the agent manages. They should be the minimum advised timeouts, but they shouldn't/cannot
cover _all_ possible resource instances. So, try to be neither overly generous nor too stingy, but moderate. The minimum timeouts should
never be below 10 seconds.
SUPPORTED PARAMETERS
OCF_RESKEY_state = string [/Dummy-{OCF_RESOURCE_INSTANCE}.state]
State file
Location to store the resource state in.
OCF_RESKEY_fake = string [dummy]
Fake attribute that can be changed to cause a reload
Fake attribute that can be changed to cause a reload
OCF_RESKEY_op_sleep = string [0]
Operation sleep duration in seconds.
Number of seconds to sleep during operations. This can be used to test how the cluster reacts to operation timeouts.
AUTHOR
Andrew Beekhof <andrew@beekhof.net>
Author.
Pacemaker Configuration 06/10/2014 OCF_PACEMAKER_DUMMY(7)