0

could you please help here, i have script which reading file from .csv like file pattern, sources path and destination path, then passing all details to CD script to do the file trasfer.

script:-

FILE_PATTERN='x'
SOURCE_PATH='y'
DEST_PATH='z'
FILE_LOCATION='/app/logs/CD_logs/checksum/dd.csv'
CD_SCRIPT='/app/logs/CD_logs/checksum/cd.sh'

x=`cut -d "," -f1 ./dd.csv`
y=`cut -d "," -f2 ./dd.csv`
z=`cut -d "," -f3 ./dd.csv`
 

. /app/sas/saslogs/CD_logs/checksum/cd.sh  $x $y $z

CSV file contain three colume

  1. File patteren
  2. sources location
  3. destination location

i am looking to modify the script to find file pattern like file name contain (filename_YYYYMMDD.txt) and find last one month and pass to CD script.

also need to add multiple sources location and destination location so that single csv file and script can help me multiple file transfer.

appreciate your help if any. thanks

D.D
  • 11
  • 1
  • 1
    What language is this script going to be run in? Is it a shell script? What shell? bash, ksh, sh, csh, something else? It is not clear what parts you have working and what parts you need help with. Are you just asking how to test if a string matches a specific date pattern? Do you just want to filter the records from the CSV file before they get to your script? Say by using grep? – Tom Jun 09 '22 at 15:00
  • Hello Tom, its shell script (bash) yes i want filter the records/data which is contains name with date (filename_YYYYMMDD.tx) and created within month so that i can pass those details to CD script for transfer. #!/bin/bash FILE_PATTERN='x' SOURCE_PATH='y' DEST_PATH='z' FILE_LOCATION='/app/logs/CD_logs/checksum/dd.csv' CD_SCRIPT='/app/logs/CD_logs/checksum/cd.sh' x=`cut -d "," -f1 ./dd.csv` y=`cut -d "," -f2 ./dd.csv` z=`cut -d "," -f3 ./dd.csv` . /app/sas/saslogs/CD_logs/checksum/cd.sh $x $y $z – D.D Jun 10 '22 at 23:42

0 Answers0