Ticket Hash: | 7a6a0da88636147ba40cc76010bdda68e6d59684 | |||
Title: | Not picking up variable values when running remote bash script with for loop | |||
Status: | Open | Type: | Incident | |
Severity: | Important | Priority: | ||
Subsystem: | Resolution: | |||
Last Modified: | 2020-04-08 11:53:25 | |||
Version Found In: | ||||
User Comments: | ||||
anonymous added on 2020-04-08 11:53:25:
my expect script copies a bash script onto a remote server it the exectues thisscript on the remote server i define a variable within the script i.e. WDIR="/data01/ftp" my for loop in the script only works if i use the directory name and not the variable DOESNT WORK:- for H in `cd $WDIR ; ls ${SITE}*log*gz | awk -F_ '{print $1}' |sort|uniq` do WORKS:- for H in `cd /data01/ftp ; ls ${SITE}*log*gz | awk -F_ '{print $1}' |sort|uniq` do |