The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
parse an arpwatch file and retain most recent mac CM64 Shell Programming and Scripting 8 04-12-2007 12:21 AM
Get the most recent file from a remote server anujairaj UNIX for Dummies Questions & Answers 5 09-27-2006 10:31 AM
getting the most recent file anujairaj Shell Programming and Scripting 3 06-22-2006 03:34 PM
Changing name of most recent file warpmail AIX 1 02-15-2006 07:34 PM
reading directory for most recent file? duncan_glover UNIX for Dummies Questions & Answers 3 08-22-2002 07:26 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 03-29-2002
josborn777 josborn777 is offline
Registered User
  
 

Join Date: Mar 2002
Location: Kansas City, MO
Posts: 1
Question Most Recent File script

OK, I know next to nothing about scripting in unix, and at the moment I don't have access to a unix environment...

We have an application that generates a text report file which is later printed. The format is this:

bbtptcYYMMDDSSCC.txt (year/month/day/second/check digit)

I want a script to scan the directory these files live in (lets call it XYZ_REPORT) for the most recent of these files (bbtptc*) and append it to a file, ie BBT_EXPORT.txt. Would this script suffice? And if not, what does it need?

#!/bin/ksh
cd $XYZ_REPORT
cp `ls -t bbptc* | head -1` bbptc_extract

Thanks in advance!
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:42 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0