LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices



Reply
 
Search this Thread
Old 05-05-2011, 07:16 AM   #1
koloth
Member
 
Registered: Jun 2004
Location: Athens, Greece
Distribution: Slackware 13.1
Posts: 98

Rep: Reputation: 17
find command uses different format for results in 10.04 lts and 8.04 lts


Hello,
I have created a piece of sw which at some point executes the find command with some parameters and parses the results. It works fine on 8.04 but i get a slighlty different behaviour from find in 10.04. Specifically if i request using printf to display the last time a file was accessed, in 8.04 i get it in integer format while in10.04 i get it in float. What is the reason? I have a feeling it is not a find version issue. Is there a way to get 10.04 to behave like 8.04?
Here is the command and the result in 10.04
Code:
/usr/bin/find /tmp -type f -printf '%p\t%s\t%A@\n'
/tmp/debug.xml    37079    1304582201.5116502900
/tmp/webpage    0    1304581917.0505157280
And how it is on 8.04
Code:
/usr/bin/find /tmp -type f -printf '%p\t%s\t%A@\n'
/tmp/webpage    59906    1304591677
/tmp/50K_1    51200    1304547070
Any help would be appreciated,
Thanks
 
Old 05-05-2011, 09:19 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

Quote:
Originally Posted by koloth
I have a feeling it is not a find version issue.
And I have a feeling it is

Code:
# On an old box:
$ find --version
GNU find version 4.2.27

$ find /tmp -type f -printf '%p\t%s\t%A@\n'
/tmp/NOSC       393     1304595008
/tmp/.X0-lock   11      1304575960

# On a recently installed box:
$ find --version
find (GNU findutils) 4.4.2

$ find /tmp -type f -printf '%p\t%s\t%A@\n'
/tmp/kvm.start.a.vm.sh.bak  1703    1304601282.0000000000
/tmp/foo        0       1304601269.0000000000
Hope this helps.
 
Old 05-05-2011, 09:51 AM   #3
koloth
Member
 
Registered: Jun 2004
Location: Athens, Greece
Distribution: Slackware 13.1
Posts: 98

Original Poster
Rep: Reputation: 17
Well you are right although i cannot find the change in the findutils changelog...

Thanks for the answer
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
No enough space error when trying upgrade ubuntu from 8.04 lts to 10.04 lts flik shen Ubuntu 5 06-15-2010 01:44 PM
Shell Script format question - output command results in quotes Barefootpanda Linux - General 5 10-14-2008 12:40 AM
LXer: I update Ubuntu 6.06 LTS and 8.04 LTS ... one has SSH issues, one does not LXer Syndicated Linux News 0 05-20-2008 08:30 AM
command to run defrag - ubuntu 6.06 lts? starkadder Linux - Newbie 4 07-10-2007 02:32 AM
When's the next LTS? Jorophose Ubuntu 3 06-02-2007 01:43 PM


All times are GMT -5. The time now is 04:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration