If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > unix shell script

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-16-08, 08:26
skarri skarri is offline
Registered User
 
Join Date: Sep 2008
Posts: 16
unix shell script

i have a folder which has some text files
i need to write a shell script which takes this folder has input and in the out put it should give
me the filenames,lastmodified date,and the lastline in each particular file
help me asap
__________________
"TALK SENSE TO FOOL. HE CALLS U FOOLISH"
Reply With Quote
  #2 (permalink)  
Old 10-16-08, 14:24
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
Thumbs down Homework?

?
And you are asking us to do your homework?

Try coding the script yourself and we could help you out if you get stuck.

.
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
  #3 (permalink)  
Old 10-17-08, 00:08
skarri skarri is offline
Registered User
 
Join Date: Sep 2008
Posts: 16
no guys here the code

Quote:
# !/bin/bash
echo -n "Enter Your Folder With Full Path : "
read path
cd $path
ls -c -lt | more
tail -1 *.*
now can u tell me whether the code works as desired or not
__________________
"TALK SENSE TO FOOL. HE CALLS U FOOLISH"
Reply With Quote
  #4 (permalink)  
Old 10-17-08, 02:33
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,268
I can't imagine a case where you might want to do somethig like this
But this is how
find . -type f -ls -exec tail -1 {} \;
Reply With Quote
  #5 (permalink)  
Old 10-17-08, 07:28
skarri skarri is offline
Registered User
 
Join Date: Sep 2008
Posts: 16
Thumbs up check this out

hey ur is running into a infinte loop
i think the follow is good if any errors plz correct
ls -c -lt | tail -1 *.* |more
__________________
"TALK SENSE TO FOOL. HE CALLS U FOOLISH"
Reply With Quote
  #6 (permalink)  
Old 10-17-08, 09:05
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
You can omit the '*.*' part.
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On