Hi all,
Need some advice.
I am attempting to write a if statment, to check a varaibale, but the output of the variable is empty (which is correct), but i am having issues write a if expression for this empty variable.
Can you please advice.
If statement - Output below
if [[ $FRAG_DUP_LTO5_1 -eq 1 || $FRAG_DUP_LTO5_2 -eq 1 ]]; then
if [[ $FRAG_LTO3_COPY_1 == "" && $FRAG_LTO3_COPY_2 == "" ]] ; then
Output of variable
+ bpimagelist -backupid ibl_1357326073
+ grep 'FRAG '
+ awk '{print $2,$9}'
+ sort -u
+ awk '{ if (L!=$1) print; L=$1}'
+ egrep -vi '\<C5|\<C6|\<W5|\<W6'
+ awk NR='=1{print $1}'
+ FRAG_LTO3_COPY_1=''
+ bpimagelist -backupid ibl_1357326073
+ grep 'FRAG '
+ awk '{print $2,$9}'
+ sort -u
+ awk '{ if (L!=$1) print; L=$1}'
+ awk NR='=2{print $1}'
+ egrep -vi '\<C5|\<C6|\<W5|\<W6'
+ FRAG_LTO3_COPY_2=''
+ bpimagelist -backupid ibl_1357326073
+ grep 'FRAG '
+ awk '{print $2,$9}'
+ sort -u
+ awk '{ if (L!=$1) print; L=$1}'
+ egrep -i '\<C5|\<C6\<W5|\<W6'
+ awk NR==1
+ wc -l
+ FRAG_DUP_LTO5_1=0
+ bpimagelist -backupid ibl_1357326073
+ grep 'FRAG '
+ awk '{print $2,$9}'
+ sort -u
+ awk '{ if (L!=$1) print; L=$1}'
+ egrep -i '\<C5|\<C6\<W5|\<W6'
+ wc -l
+ awk NR==1
+ FRAG_DUP_LTO5_2=0
+ echo ''
Output of the if statement
+ [[ 0 -eq 1 ]]
+ [[ 0 -eq 1 ]]
+ [[ '' -eq 0 ]]