Re: Script help needed...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@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.
-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subjecthttps://www.redhat.com/mailman/listinfo/redhat-list


[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux