Quote:
Sorry, typical newbie mistake: it's looking for "$NUM_" and finding it undefined. You need to say "${NUM}_" in order to show where the variable name ends and the context string starts.
Hello,
not sure if i am doing anything wrong.. but all the files are getting gzipped. Can someone help
-rw-r----- 1 oraukp dba 93237760 Apr 6 19:51 UKPP1_1_994_639156890.arc
-rw-r----- 1 oraukp dba 64181248 Apr 7 02:10 UKPP1_1_995_639156890.arc
-rw-r----- 1 oraukp dba 2048 Apr 7 02:10 UKPP1_1_996_639156890.arc
-rw-r----- 1 oraukp dba 86528 Apr 7 02:11 UKPP1_1_997_639156890.arc
-rw-r----- 1 oraukp dba 1024 Apr 7 02:11 UKPP1_1_998_639156890.arc
-rw-r----- 1 oraukp dba 1024 Apr 7 02:11 UKPP1_1_999_639156890.arc
-rw-r----- 1 oraukp dba 115200 Apr 7 02:12 UKPP1_1_1000_639156890.arc
-rw-r----- 1 oraukp dba 14367744 Apr 7 05:00 UKPP1_1_1001_639156890.arc
-rw-r----- 1 oraukp dba 587776 Apr 7 05:00 UKPP1_1_1002_639156890.arc
-rw-r----- 1 oraukp dba 38299648 Apr 7 12:00 UKPP1_1_1003_639156890.arc
-rw-r----- 1 oraukp dba 13824 Apr 7 12:01 UKPP1_1_1004_639156890.arc
drwxr-xr-x 2 oraukp dba 5120 Apr 7 12:10 .
drwxr-xr-x 4 oraukp dba 96 Apr 7 12:24 ..
[oraukp] "gbwxvcsmbc1:"/gbwaapsmbp1/ora01/app/oracle/admin/UKPP1/arch:
UKPP1> COUNT=999
[oraukp] "gbwxvcsmbc1:"/gbwaapsmbp1/ora01/app/oracle/admin/UKPP1/arch:
UKPP1> ls | sed -e "/UKPP1_1_${COUNT}_/q" | xargs gzip -9
[oraukp] "gbwxvcsmbc1:"/gbwaapsmbp1/ora01/app/oracle/admin/UKPP1/arch:
UKPP1> ls -lart
total 51738
-rw-r----- 1 oraukp dba 24172665 Apr 6 19:51 UKPP1_1_994_639156890.arc.gz
-rw-r----- 1 oraukp dba 15265903 Apr 7 02:10 UKPP1_1_995_639156890.arc.gz
-rw-r----- 1 oraukp dba 549 Apr 7 02:10 UKPP1_1_996_639156890.arc.gz
-rw-r----- 1 oraukp dba 219 Apr 7 02:11 UKPP1_1_998_639156890.arc.gz
-rw-r----- 1 oraukp dba 27022 Apr 7 02:11 UKPP1_1_997_639156890.arc.gz
-rw-r----- 1 oraukp dba 223 Apr 7 02:11 UKPP1_1_999_639156890.arc.gz
-rw-r----- 1 oraukp dba 27332 Apr 7 02:12 UKPP1_1_1000_639156890.arc.gz
-rw-r----- 1 oraukp dba 3632384 Apr 7 05:00 UKPP1_1_1001_639156890.arc.gz
-rw-r----- 1 oraukp dba 143206 Apr 7 05:00 UKPP1_1_1002_639156890.arc.gz
-rw-r----- 1 oraukp dba 9693938 Apr 7 12:00 UKPP1_1_1003_639156890.arc.gz
-rw-r----- 1 oraukp dba 4766 Apr 7 12:01 UKPP1_1_1004_639156890.arc.gz
drwxr-xr-x 4 oraukp dba 96 Apr 7 12:24 ..
drwxr-xr-x 2 oraukp dba 5120 Apr 7 12:26 .