[Abcde-users] Patch to tidy the main routine, and avert loosing variable declarations by not using subshells

Roger rogerx.oss at gmail.com
Mon Mar 23 15:38:15 GMT 2015


I posted this to the Google Code issues, but doubt there's a large following of 
users monitoring issues there.  Mailing list might be the better option for 
attracting attention for smaller projects as this one.

This patch is my first initial attempt to tidy or clean the main routine for 
readability.

1) Replaced the parenthesis within two or three sections of the main routine 
witth curly braces.

2) Indented the sections code within curly braces, improving readabilty and 
making finding the beginning and ending of the sections of scripting/coding 
much easier.  (Now the indent style matches the indentation of the functions 
above.)

3) Then I noticed the following when further researching the chars used to 
section scripting within Bash:

    From http://tldp.org/LDP/abs/html/special-chars.html

    () command group.
    A listing of commands within parentheses starts a subshell.

    Variables inside parentheses, within the subshell, are not visible to the 
    rest of the script.


Might want to test some of your customizations requiring reiterating over past 
variable definitions now?  Shrugs.  They just might work!  (NOTE: I've yet to 
double check over the entire abcde script for parenthesis usage, and replacing 
with curly braces.)

I have tested this and seems to work without issues.  Double check to make sure 
backgrounding of encoding is still working, and should be as I think it only 
requires the '&' char.  I dislike mangling others larger projects due to the 
requirement of more time for reading and interpreting scripting/coding, and the 
fact I can more easily miss something.



-- 
Roger
http://rogerx.freeshell.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: abcde-tidymainpipes.patch
Type: text/x-diff
Size: 26152 bytes
Desc: not available
URL: <http://lists.einval.com/pipermail/abcde-users/attachments/20150323/e0624908/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.einval.com/pipermail/abcde-users/attachments/20150323/e0624908/attachment-0001.sig>


More information about the Abcde-users mailing list