The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
shell script help: sorting, incrementing environment variables and stuff secoif Shell Programming and Scripting 1 05-08-2008 08:04 AM
Sorting : satyam_sat Shell Programming and Scripting 3 04-15-2008 01:30 PM
Sorting in C++.. ronix007 High Level Programming 6 03-06-2008 05:16 PM
sorting in awk mahabunta Shell Programming and Scripting 3 01-31-2007 01:56 AM
Sorting mp3 penguin-friend Shell Programming and Scripting 3 05-13-2005 04:21 AM

Closed Thread
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
  #1 (permalink)  
Old 05-09-2006
anujairaj anujairaj is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 13
Sorting in a script

Hello,
I have a situation where I have filenames with timestamps like
abc20060509452313.txt

i need the most recent file, and i am using this command in the script:
recent_file=`ls ${Location}/$file*| head -1`

where $Location is the directory and $file is the base filename like abc.
When i debug it ,it says :
the file /.../.../abc* doesnot exist.


is there anything wrong with the quotes?
Any help would be appreciated.
Thank You,
  #2 (permalink)  
Old 05-09-2006
thestevew thestevew is offline
Registered User
  
 

Join Date: Mar 2006
Location: South Yorkshire, UK
Posts: 114
Works for me on AIX (5.x) with ksh.
Are you sure that your Location (capital L) and file (all lower case) variables are spelt right and have got the right values?
What command did you use to get the error message?

cheers
  #3 (permalink)  
Old 05-09-2006
anujairaj anujairaj is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 13
Thanks for the response,
The command works for me,but it does not work in a script,and I donot what went wrong.
Anyway i used set-x at the beginning of the script to debug it.
Closed Thread

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 07:58 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