pattern search in unix [message #652192] |
Fri, 03 June 2016 18:55 |
namitanamburi
Messages: 35 Registered: March 2009
|
Member |
|
|
Please look at the code below.
if [ $WRITE_TO_FILE = Y ]; then
Copyfiles $DB_SERVER:$OUT_DIR/?????_?????_${PGM_NAME}_${TIMESTAMP}_summary.txt $OUT_DIR -p
fi
So above code will bring files like below........
MBR09_CTRT6_pkg-get-mbr-contract_20160602102003_summary.txt
however I need files
MB_CTRT6_pkg-get-mbr-contract_20160602102003_summary.txt
MBR_CTRT6_pkg-get-mbr-contract_20160602102003_summary.txt
MBR8_CTRT6_pkg-get-mbr-contract_20160602102003_summary.txt
The first string before _ can be 2 or more than 2 characters(sucha s MB, MBR, MBR8), above code will bring back only MBR08 as ????? which means it is looking for 5 characters.
Please help.
|
|
|
|
|