Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Rename file knowing the first 7 carachters Post 302179770 by radoulov on Friday 28th of March 2008 12:58:13 PM
Old 03-28-2008
Code:
awk 'BEGIN {
m["JAN"] = "01"
m["FEB"] = "02"
m["MAR"] = "03"
m["APR"] = "04"
m["MAY"] = "05"
m["JUN"] = "06"
m["JUL"] = "07"
m["AUG"] = "08"
m["SEP"] = "09"
m["OCT"] = "10"
m["NOV"] = "11"
m["DEC"] = "12"
sep = "_"
new = "IN_PROV"
ext = ".dat"
for (i=1; i<ARGC; i++) {
  split(ARGV[i], t, sep)
  print "mv", ARGV[i], new sep substr(t[3],1,4) m[t[2]] ext
   }
}' PROVEDP_*

Use nawk or /usr/xpg4/bin/awk on Solaris.
If you get the correct result, pass the output to the shell via pipe.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

problem knowing disk space

i am a fresh person learning sco open server 5.5:confused: how should i know that how much space is occupied & how much is free on a particular partition?please help (1 Reply)
Discussion started by: buntty
1 Replies

2. AIX

Knowing when is the user id expiring

HI, Do we have a command in AIX which will let us know when is the user id password getting expired!! Any advice will be of great help!! Thanks, Siddharth (0 Replies)
Discussion started by: siddhhuu
0 Replies

3. UNIX for Advanced & Expert Users

knowing progress while reading a file

Hi, I am parsing a very big file say 10 MB. It 'll take more than an hour ..I want to know the progress say in % .Is there any way to do that??? or (Is there any way to know which line of the file I am in ) (2 Replies)
Discussion started by: sakthi.abdullah
2 Replies

4. Solaris

Knowing global zone

Hi All, I was asked these question long time back, Is there any way to know frm non-global zone to know which is the global zone it belongs? As per my knowledge there is no way and i have looked for these topic for a quite a while and researched on it .I just want to be sure if i am... (1 Reply)
Discussion started by: sahil_shine
1 Replies

5. Shell Programming and Scripting

Knowing whether the file has completely SFTP ed

Hi.. Can Anyone out there help me? I need to write a script to convert a file in EDCIDC format to CSV The files will be transfered through sftp to the box. Is there a way to check the file has finished being transfered or still transfering. so that my conversion task will be performed after... (3 Replies)
Discussion started by: ramukandada
3 Replies

6. Shell Programming and Scripting

how to use the filehandle stored in a variable without knowing its file association

how to use the filehandle stored in a variable without knowing its file association i.e. the filename code my $logFH = $connObj->get('logFH'); infoPrint("Variable is of type IO \n") if(UNIVERSAL::isa($logFH, 'IO')); infoPrint("$logFH\n"); output == INFO :: Variable is of type... (0 Replies)
Discussion started by: rrd1986
0 Replies

7. UNIX for Dummies Questions & Answers

Knowing when a different program modifies a file

so i was testing something on a test box running linux. i manually vi'ed the /var/log/messages file. and i noticed, the file immediately stopped being updated. it wasn't until i restarted the syslog process that events started being recorded in it again. so that tells me, the syslog process... (20 Replies)
Discussion started by: SkySmart
20 Replies

8. Shell Programming and Scripting

As knowing which version has the awk?

friends How do I know which version of awk using my linux? (2 Replies)
Discussion started by: tricampeon81
2 Replies

9. Shell Programming and Scripting

Curl to download file from subdivx.com after following location without knowing the file name/extens

This question could be specific to the site subdivx.com In the past, I've been able to download a file following location using cURL but there is something about subdivx.com that's different and can't figure out how to get it to work. I tried the following directly in the terminal with no... (5 Replies)
Discussion started by: MoonD
5 Replies

10. UNIX for Advanced & Expert Users

Knowing the boot files

Hi, I have experienced a situation whereby after rebooting the server, we were not able to bring it up. After further troubleshooting it was found that it was an issue with the "boot" image/file permission. Have you experienced such an issue? I was not the one who did the troubleshooting... (1 Reply)
Discussion started by: anaigini45
1 Replies
install::TempContent::Objects::mod_perl-2.0.9::docs::apiUserRContribuinstall::TempContent::Objects::mod_perl-2.0.9::docs::api::APR::BucketAlloc(3)

NAME
APR::BucketAlloc - Perl API for Bucket Allocation Synopsis use APR::BucketAlloc (); $ba = APR::BucketAlloc->new($pool); $ba->destroy; Description "APR::BucketAlloc" is used for bucket allocation. "new" Create an "APR::BucketAlloc" object: $ba = APR::BucketAlloc->new($pool); class: "APR::BucketAlloc" arg1: $pool ( "APR::Pool object" ) The pool used to create this object. ret: $ba ( "APR::BucketAlloc object" ) The new object. since: 2.0.00 This bucket allocation list (freelist) is used to create new buckets (via "APR::Bucket->new") and bucket brigades (via "APR::Brigade->new"). You only need to use this method if you aren't running under httpd. If you are running under mod_perl, you already have a bucket allocation available via "$c->bucket_alloc" and "$bb->bucket_alloc". Example: use APR::BucketAlloc (); use APR::Pool (); my $ba = APR::BucketAlloc->(APR::Pool->pool); my $eos_b = APR::Bucket::eos_create($ba); "destroy" Destroy an "APR::BucketAlloc object": $ba->destroy; arg1: $ba ( "APR::BucketAlloc object" ) The freelist to destroy. ret: no return value since: 2.0.00 Once destroyed this object may not be used again. You need to destroy $ba only if you have created it via "APR::BucketAlloc->new". If you try to destroy an allocation not created by this method, you will get a segmentation fault. Moreover normally it is not necessary to destroy allocators, since the pool which created them will destroy them during that pool's cleanup phase. See Also mod_perl 2.0 documentation. Copyright mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0. Authors The mod_perl development team and numerous contributors. perl v5.18.2 2install::TempContent::Objects::mod_perl-2.0.9::docs::api::APR::BucketAlloc(3)
All times are GMT -4. The time now is 09:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy