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

Notices

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

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

Posted 11-17-2011 at 05:31 PM by SilversleevesX
Updated 11-17-2011 at 05: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:
Code:
gdate=$(stat -c %y foo.jpg)
pqdate=$(echo ${gdate%.*})
...
Member
Posted in Discussion
Views 371 Comments 0 SilversleevesX is offline
Old

Same advice produces the same results

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

http://www.linuxquestions.org/questi...7/#post4071846

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...
Member
Posted in Discussion
Views 621 Comments 1 SilversleevesX is offline
Old

XRef to new thread on unix.com.

Posted 08-01-2010 at 07:27 PM by SilversleevesX
Updated 08-01-2010 at 07:30 PM by SilversleevesX

http://www.unix.com/shell-programmin...e-problem.html
Member
Posted in Discussion
Views 464 Comments 0 SilversleevesX is offline
Old

A Windows weakness

Posted 05-19-2009 at 06:23 PM by SilversleevesX
Updated 07-25-2010 at 09: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]"*,...
Member
Posted in Discussion
Views 682 Comments 0 SilversleevesX is offline
Old

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

Posted 05-12-2009 at 07:56 AM by SilversleevesX
Updated 07-25-2010 at 09: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.)...
Member
Posted in Discussion
Views 1086 Comments 1 SilversleevesX is offline

  



All times are GMT -5. The time now is 01:53 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