Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Unknown Newsgroups: comp.os.linux.misc Subject: Re: bash script problem ? Date: Wed, 23 Mar 2016 19:46:10 -0000 (UTC) Organization: A noiseless patient Spider Lines: 123 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 23 Mar 2016 19:46:10 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="68ca5516d9b0e59079a3f147d22eb5c3"; logging-data="28033"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18G0bh7DtQwypd3FEQo2IM7eR/oxyMkg1w=" User-Agent: Pan/0.133 (House of Butterflies) Cancel-Lock: sha1:BXyjVB8Fv5Up4Qq2p6pm79OJRCo= Xref: csiph.com comp.os.linux.misc:17095 On Thu, 17 Mar 2016 14:07:13 +0000, Joe Beanfish wrote: > On Thu, 17 Mar 2016 11:00:14 +0000, Unknown wrote: > >> On Wed, 16 Mar 2016 17:08:56 +0000, William Unruh wrote: >> >>> On 2016-03-16, no.top.post@gmail.com wrote: >>>> In article <>, Teemu Likonen wrote: >>>> >>>> >>>>> rich@example.invalid [2016-03-10 15:22:57Z] wrote: >>>>> >>>>> > Step 1, don't use the legacy sh backtick substitution syntax for >>>>> > this (because it cannot nest). Use Bash's $() substitution >>>>> > instead (because it can nest). >>>>> >>>>> I agree that $() is better but ``'s can nest:=20 >>>>> >>>>> $ echo Year: `date \`echo +%Y\`` >>>>> Year: 2016 >>>>> >>>> That's spooky ! Who +%Y with "2016" ? >>> >>> The command "date" did. This says to run the date command with the >>> argument being the output of the echo command. In this case the latter >>> as +%Y so this is running date +%Y which is the year in which the date >>> command was run. The ouput is then the argument to the outter echo >>> command. >>> >>> >>>> Lets have some examples of nesting, without extra spooky-stuf. >>> >>> extra spooky-stuf? >>> man date >>> >>> >> date `echo +%Y` == 2016 >> echo `date \`echo +%M\`` == 33 >> echo `date \`echo +%D\`` == 03/17/16 date `echo +%M` == 35 >> date `echo +%D` == 03/17/16 >> >> There's nesting: lisp; & there's concatenation/piping; but this is a >> load of ad-hoc crap! >> >> >> BTW `wily` is great for this. >> No need to touch the kybrd. > > > Not crap, beauty. The command line lets you form things the original > author didn't conceive of. Unlike most GUIs which only allow the small > set of things the author thought to allow you to do. > > Sure the above examples are contrived and one would normally just > date +%Y > But in a more complex situation as your original script the ad-hoc > ability of the command line is very useful and powerful. We're losing each other. 1. ad-hoc is when there are many ways of "saying it" instead of having a minimalist/limited syntax: like lego or bricks&mortat or lisp. When I looked at Ruby I remember you could . That's bad. Redundancy is to be avoided. 2. GUI usually means 'cartoon based' - US-style. text means you execute a 50-char command with one-action, without; 1. need to rememeber it - you recognise and select it from a menu; 2. no need to look away from the screen and lose 'focus'. Here's an example of what wily does for me [ETHOberon is better because it's got colors, which helps decode my cryptic short-hand]: Mwt <-- writes the TextToSpeech-Menu for Wily; which looks like:- 1=Select DestName & M2M1: |Arg1 to /mnt/h15/var/CONTROL/WtmpL 2=Append Text Selection & M2 |Apnd1 : to tail -2 /var/CONTROL/WApnd 3=M2 DLt2wavMul : <1>.mp3 to /mnt/h14/home/crg/mul/ ^ M2M1 rm As stated, this mess is better understood with colors. The task is to copy text to .mp3 to a mobile phone. There are 2 args: 1. the text-stretch, identified by its begin and end; 2. the chosen name of the *.mp3 But I wanted to make it more versatile by being able to append pieces of text to a buffer,to a get a minimum of 5 minutes speech. If I see a suitable name anywhere on the screen, it's 2 cliks to select that name: 1 to