Home » Infrastructure » Unix » pattern search in unix (SunOS )
pattern search in unix [message #652192] Fri, 03 June 2016 18:55 Go to next message
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.





Re: pattern search in unix [message #652195 is a reply to message #652192] Fri, 03 June 2016 19:33 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10679
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
magvivek@kalyani#ls -lart *.txt
-rw-r--r--  1 magvivek  staff  0 Jun  3 20:29 MB_CTRT6_pkg-get-mbr-contract_20160602102003_summary.txt
-rw-r--r--  1 magvivek  staff  0 Jun  3 20:29 MBr_CTRT6_pkg-get-mbr-contract_20160602102003_summary.txt
-rw-r--r--  1 magvivek  staff  0 Jun  3 20:29 MBr9_CTRT6_pkg-get-mbr-contract_20160602102003_summary.txt
-rw-r--r--  1 magvivek  staff  0 Jun  3 20:29 MB09_CTRT6_pkg-get-mbr-contract_20160602102003_summary.txt
-rw-r--r--  1 magvivek  staff  0 Jun  3 20:30 MBr09_CTRT6_pkg-get-mbr-contract_20160602102003_summary.txt
magvivek@kalyani#ls -alrt {??,???,????,?????}_?????_*
-rw-r--r--  1 magvivek  staff  0 Jun  3 20:29 MB_CTRT6_pkg-get-mbr-contract_20160602102003_summary.txt
-rw-r--r--  1 magvivek  staff  0 Jun  3 20:29 MBr_CTRT6_pkg-get-mbr-contract_20160602102003_summary.txt
-rw-r--r--  1 magvivek  staff  0 Jun  3 20:29 MBr9_CTRT6_pkg-get-mbr-contract_20160602102003_summary.txt
-rw-r--r--  1 magvivek  staff  0 Jun  3 20:29 MB09_CTRT6_pkg-get-mbr-contract_20160602102003_summary.txt
-rw-r--r--  1 magvivek  staff  0 Jun  3 20:30 MBr09_CTRT6_pkg-get-mbr-contract_20160602102003_summary.txt
Re: pattern search in unix [message #652303 is a reply to message #652192] Mon, 06 June 2016 13:53 Go to previous message
Michel Cadot
Messages: 65254
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

This question bears no real connection with Oracle database.
Please find a more appropriate forum.
The topic is locked. /forum/fa/448/0/
If I'm wrong, please, PM me (or report this message to a moderator, explain why you think it should be unlocked and it might be done).

Previous Topic: audit_sys_operations
Next Topic: Software for oracle 11.2.0.4 enterprise edition 32 bit on solaris sparc
Goto Forum:
  


Current Time: Thu Dec 14 17:04:27 CST 2017

Total time taken to generate the page: 0.03625 seconds