Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Blogs > SilversleevesX
User Name


Discussion No code, no helps or assists, just giving opinions and pov.

'stat' vs 'date' w/re string manipulation in Bash scripts

Posted 11-17-2011 at 06:31 PM by SilversleevesX
Updated 11-17-2011 at 06:42 PM by SilversleevesX

I started browsing the Web tonight looking to do something I had been doing in my Bash scripts with stat and three more lines of string cutting in one line instead.

I had been using stat -c &y file to get a file's modification date in scripts, but I have never liked the nine-digit "blink-of-an-eye" part of the return on that command. My method up till now has been to eliminate it with lines like these:
gdate=$(stat -c %y foo.jpg)
pqdate=$(echo ${gdate%.*})
Posted in Discussion
Views 442 Comments 0 SilversleevesX is offline

Same advice produces the same results

Posted 08-19-2010 at 09:41 PM by SilversleevesX

Read the first reply, then read here:

If the definition of insanity is doing the same thing twice (or more times) and expecting different results, then the question becomes: "Who's the more insane? The person who follows the advice, knowing in advance it probably won't make any difference or work out the way they want it to, or the person who, after...
Posted in Discussion
Views 688 Comments 1 SilversleevesX is offline

XRef to new thread on

Posted 08-01-2010 at 08:27 PM by SilversleevesX
Updated 08-01-2010 at 08:30 PM by SilversleevesX
Posted in Discussion
Views 525 Comments 0 SilversleevesX is offline

A Windows weakness

Posted 05-19-2009 at 07:23 PM by SilversleevesX
Updated 07-25-2010 at 10:13 AM by SilversleevesX

Thinking like a Mac-user again, I came up with this.

If, in Windows XP, the Desktop is, as it is in Mac OS X, a legitimate and discrete folder, then why, when one has "Command Prompt Here" and "Terminal Here" type patches to their context menu, is one unable to use them by simply right-clicking on some unoccupied space in the Explorer Desktop? Why, indeed, does one have to follow the monotonous path of "My Computer/C/Documents and Settings/[username]"*,...
Posted in Discussion
Views 715 Comments 0 SilversleevesX is offline

While I'm thinking about the Mac Universe, a limerick.

Posted 05-12-2009 at 08:56 AM by SilversleevesX
Updated 07-25-2010 at 10:18 AM by SilversleevesX

This guy Jobs from north California
Has a fetish for Mach, though, I warn ya;
He may never believe
Someone ought to tell Steve
This is why bright people scorn ya.

(Inspired partly by hearing that Linus Torvalds said he didn't like Mac OS X because Jobs had woven in his -- Linus's -- nemesis, the Mach microkernel. This isn't the first time Jobs has either overseen or damned the lifeboats to put Mach into an Apple product -- those who know, remember MKLinux.)...
Posted in Discussion
Views 1165 Comments 1 SilversleevesX is offline


All times are GMT -5. The time now is 07:43 PM.

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