Script help needed...

Magnus Andersen mag.andersen at gmail.com
Wed Jan 4 20:27:51 UTC 2006


Did the following test...

Declared variable R as an integer variable and set it to 0.  The value is
changed inside the loop to 1, but again on the outside it is 0.  See in
bold.

[root at toracle tmp]# ./nfstest.sh nas
++ declare -i R
++ R=0
++ LOC=
++ PID=23974
++ NASDIR=/tmp/nfs1
++ MAESTRODIR=/tmp/nfs2
++ PIDFILE=/tmp/nfstest.pid
++ '[' -z nas ']'
++ WRITEDIR=/tmp/nfs1
++ '[' '!' -f /tmp/nfstest.pid ']'
++ cat /tmp/nfstest.pid
++ read LINE
++ '[' -z '23948 nas' ']'
+++ echo 23948 nas
+++ awk '{ print $1 }'
++ OLDPID=23948
+++ ps aux
+++ grep 23948
+++ grep -v grep
+++ wc -l
+++ tr -d ' '
++ RUNNING=1
++ '[' 1 = 0 ']'
++ ((  R = 0 + 1  ))
++ echo 'INSIDE R = 1'
INSIDE R = 1
+++ echo 23948 nas
+++ awk '{ print $2 }'
++ LOC=nas
++ read LINE
++ echo 'OUTSIDE R = 0'
OUTSIDE R = 0

--
Magnus Andersen
Systems Administrator / Oracle DBA
Walker & Associates, Inc.



More information about the redhat-list mailing list