bug-hurd
[Top][All Lists]
Advanced

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

Re: OT: automation


From: Arne Babenhauserheide
Subject: Re: OT: automation
Date: Wed, 4 Nov 2009 10:59:05 +0100
User-agent: KMail/1.12.2 (Linux/2.6.30-gentoo-r5; KDE/4.3.2; x86_64; ; )

Am Sonntag, 1. November 2009 13:17:27 schrieb address@hidden:
> On Thu, Oct 29, 2009 at 08:34:50AM +0100, Arne Babenhauserheide wrote:
> I think that already hints at the problem: while such tools are trivial
> enough for the really simple use cases (e.g. "zmv '*.JPG' '*.jpeg'"),
> there is always a drift towards adding more and more features, to cover
> additional use cases... 

I try to keep that drift low, exactly because I don't want them to become 
complex monsters. 

If I need more complex stuff I can always use (bash) pre- and postprocessing :) 

For one of my tools I just included one option to kick out most of that drift: 
python preprocessing -> you can pass a string with python-code to modify a 
variable (markdown_data). 

Whenever I need to do some complex preprocessing, I can just put it into that 
string and need not worry about making the program bigger (it's in python 
anyway, so almost the whole code for that is "exec(PYTHON_STRING)"). 

> history), or things that I use *really* often. For example I used to do
> my Google and LEO searches by hand:
> 
>    netrik google.com/search?q=foo+bar
>    netrik dict.leo.org?search=foo+bar
> 

For these I use alt-F2 and Konqueror: 

alt-F2 -> gg:google search -> enter -> konqueror starts the search. Just like 
a shell, but with images :) 

>    leo() { netrik dict.leo.org?search="$*"; }
>    go() { netrik google.com/search?q="$*"; }

Which look almost exactly like the functions you can define in konqueror - but 
I'll try to remember them for shell work. 
 
> Things like renaming multiple files, or global search and replace, do
> not fall in either of the categories mentioned above: they are trivial
> enough to type them out (or recall from history)

Not for me at least... I suffered escaping-hell often enough to write scriipts 
to avoid it :) 

> > I think it might be "Python feels like home for me"-specific ;)
> 
> Which just proves my point really: generic knowledge beats more specific
> tools :-) You prefer Python over sed, even though it's more complicated
> to accomplish certain tasks, because you can use the Python knowledge
> for more things. And for the very same reason shell scripting is better
> than specific tools most of the time.

Touché :) 

> > Might be related to having many spaces and non-letter characters in
> > filenames, since the OS and tools damn well should not restrict how I
> > name my files :)
> 
> It shouldn't, and it doesn't. But that doesn't mean it's a good idea to
> make use of this possibility...

I tend to differ. I use GUIs most of the time, and most of my friends do that, 
too, so my files with spaces etc. are far more convenient (easier to read) than 
files with underscores and escapes like "ae" for "ä". 

But many shell commands make it inconvenient to work with them (mostly for 
stuff like argument parsing, though). 

> In the same vein, you could argue that a programming language should not
> restrict characters you can use in an identifier -- and indeed some
> languages (PHP being one of them IIRC) allow pretty much everything in
> identifies, including spaces. 

Python3 now allows about everything except spaces - and I hope that over the 
next few years most programs will switch to it, so it can become the standard 
installed version. 

> Still it's not very wise to use such
> identifiers. Just use underscores and profit.

I'd have changed the last word into "suffer eye pain" - at least for normal 
files :) 

But in code I agree. I want it to be readable to others more than I want it to 
look nice to me. 

Best wishes, 
Arne

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]