![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| searching files inside directory | kylethesir | UNIX for Dummies Questions & Answers | 4 | 06-06-2008 01:44 AM |
| searching files through all subdirectories beneath the current directory | milagros | Shell Programming and Scripting | 5 | 05-15-2007 04:00 PM |
| Searching for files over 30 days old in current directory | cxredd4 | Shell Programming and Scripting | 18 | 06-11-2006 02:16 AM |
| Searching for directory | Enigma23 | Shell Programming and Scripting | 8 | 04-08-2005 09:31 PM |
| directory searching | st00pid_llama | Shell Programming and Scripting | 2 | 05-10-2004 07:21 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Searching files in a directory.Urgent
Hi everyone,
I need to search files starting with RPT_0, RPT_1,........ in a directory. How can I implement that through a shell script. Also I want to read the last line of each file after searching them. Can someone help me out in this regard. One more thing how I can extract a particular pattern in the last line of the file. Eg: ### Job 65 (RPT507A BBW ): 390 lines, 7 pages, 10/26/2005 01:55:16 In the above line I have extract RPT507A BBW and convert that space between RPT507A and BBW with underscore( _ ). Thanks in advance... srivsn |
|
||||
|
Renaming and deleting old file. Pls help
Hi everyone,
Thx a lot Mona for your reply. It worked. Little modifications. I am extremely new to this Unix. Please help. After extracting the name from the code below, I want to move the contents of the old file to the new one extracted. We have to delete the old file. Also concatinate the new file name with DD(current day). I will give you a example below. RPT_1.txt(old filename) ### Job 65 (RPT507A BBW ): 390 lines, 7 pages, 10/26/2005 01:55:16(last line of file RPT_1.txt) By using the logic given in reply mail, I will get the output as RPT507A_BBW Now I want to concatinate that with DD(day). So my output is RPT507A_BBW09 (09 is today) Also I want to append all the files in RPT_1.txt to new filename RPT507A_BBW09 and delete the old file RPT_1.txt. The same logic has to be implemented for all the files in the directory starting with RPT_*.txt. Thanks to all, srivsn |
|
||||
|
Parameterising the file pattern
Hi Mona/everyone,
Thx again for Mona . I need to pass RPT_ as parameter to the shell script which I have below. Say I have created a shell script rn.sh with the code in last reply. Now instead of RPT_ hard coding, I need to give a parameter there and I am using this script in some other job. There I will give the parameter value which includes path name along file name(RPT_). Could you help me in this.....Please give the syntax also.Thanks, srivsn |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|