Re: scripts one after the other

2016-03-28 Thread Greg Wooledge
On Sat, Mar 26, 2016 at 01:28:56AM +, Val Krem wrote:
> Both scrips do have common variables  (var1 , var2 and var3) and also some 
> input and output folder name defined.
> 
> At the present I have defined the variables and folders path in both scripts.
> 
> Instead of this,  is it possible to combine the two scripts in one so that I 
> can define the varietals at one spot.  It would be less prone to error.

Yes, you can obviously write a single script that does the work of
both of them.  Or you can move the variables to a config file, and
source that from both scripts.

> unzip ${df1}/'var.zip' -d ${f1}
> hashE ${f1}/${var1}_filename.csv>  ${f2}/output.txt

You really need to quote properly.

unzip "$df1/var.zip" -d "$f1"
hashE "$f1/${var1}_filename.csv" > "$f2/output.txt"

And so on.

All parameter expansions should be double-quoted, except in the small
number of places where it's unnecessary.  If you don't know what those
exceptions are, then *always* double-quote.  It never hurts.

The curly braces are optional in all cases except when the variable name
is followed by legal identifier characters, as in your ${var1}_filename
case here.  The curly braces are never a substitute for quotes.  The
quotes are still required.



Re: 4.4-rc1: readline wrapping error when prompt wraps around

2016-03-28 Thread Chet Ramey
On 3/26/16 6:08 AM, Andreas Schwab wrote:
> When $PS1 contains \[ \] and is longer than the line length then
> readline miscounts the wrap coloumn.  For example, set PS1 like this:
> 
> PS1="\[$(tput bold)\]$(printf '%*s' $(stty size | awk '{print$2}') x)\[$(tput 
> sgr0)\] "
> 
> This causes readline to wrap the input too early by the amount of hidden
> characters inside \[ \].

Thanks for the report.  This will be fixed in the bash-4.4 release.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/