Expect

Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8a1342deb7db61f3976a3b0fd652c6595ac364d6
Ticket: 7a6a0da88636147ba40cc76010bdda68e6d59684
Not picking up variable values when running remote bash script with for loop
User & Date: anonymous 2020-04-08 11:53:25
Changes

  1. icomment:
    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
    
  2. login: "anonymous"
  3. mimetype: "text/plain"
  4. private_contact changed to: "9cb6bfaf8f775898d0132da693a27c2ed81b020a"
  5. severity changed to: "Important"
  6. status changed to: "Open"
  7. title changed to:
    Not picking up variable values when running remote bash script with for loop
    
  8. type changed to: "Incident"