Re: Dolphin service menu help: preserve file timestamp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 17, 2010 at 20:30, Alex Schuster <wonko@xxxxxxxxxxxxx> wrote:
> Yes. Something like this (untested):
>
> #!/bin/bash
>
> while (( $# ))
> do
> Â Â Â Âdate=$( ls -l --full-time "$1" |
> Â Â Â Â Â Â Â Âawk '{ print $6" "$7 }' |
> Â Â Â Â Â Â Â Âsed 's/.00000*//g' )
> Â Â Â Âiconv -f CP1255 -t UTF-8 "$1" > "$1-utf8"
> Â Â Â Âtouch -d "$date" "$1-utf8"
> Â Â Â Âshift
> done
>

Thanks. I have some googling to do, but I'll ask anyway:


> while (( $# ))
Does this mean to go through each CLI argument, something like foreach?


What does the "shift" line do?


>        date=$( ls -l --full-time "$1" |
>                awk '{ print $6" "$7 }' |
>                sed 's/.00000*//g' )
This is pure genius, I was wondering exactly how difficult it would be
to get this info into a variable in the format that touch would use.


> If you want to replace the files, you could proabaly use recode, which keeps
> the time unless told otherwise:
> Exec=recode CP1255..utf8 %f
>

Actually, this is _exactly_ what I need. Thanks!

-- 
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com
___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.



[Index of Archives]     [Trinity (TDE) Desktop Users]     [Fedora KDE]     [Fedora Desktop]     [Linux Kernel]     [Gimp]     [GIMP for Windows]     [Gnome]     [Yosemite Hiking]
  Powered by Linux