Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Tiny fix: getting rid of ( subshell ) and adding "" to preserve the space. #53

Merged
merged 1 commit into from

2 participants

@aborrero

Characters ( and ) creates subshell and then executes the list of commands, { is smarter and faster.

When using -z you need "" or you will be evaluating the ']' character if $1 is unset.

Arturo Borrero Gonzalez Characters ( and ) creates subshell and then executes the list of com…
…mands, { is smarter and faster.

When using -z you need "" or you will be evaluating the ']' character if $1 is unset.
d28881a
@holman holman merged commit ef8ec23 into holman:master
@holman
Owner

Cool! Thanks.

@aborrero

:) thanks you for merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 11, 2012
  1. Characters ( and ) creates subshell and then executes the list of com…

    Arturo Borrero Gonzalez authored
    …mands, { is smarter and faster.
    
    When using -z you need "" or you will be evaluating the ']' character if $1 is unset.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  spark
View
3  spark
@@ -65,6 +65,7 @@ spark()
# print ticks
local ticks=(▁ ▂ ▃ ▄ ▅ ▆ ▇ █)
+ # this is fine, but normal people don't understand it -_-
local f=$(( (($max-$min)<<8)/(${#ticks[@]}-1) ))
(( f < 1 )) && f=1
@@ -79,7 +80,7 @@ spark()
[[ ${#BASH_SOURCE[@]} -eq 1 ]] || return
# show help for no arguments if stdin is a terminal
-if ([ -z $1 ] && [ -t 0 ]) || [ "$1" == '-h' ]
+if { [ -z "$1" ] && [ -t 0 ] ; } || [ "$1" == '-h' ]
then
help
exit
Something went wrong with that request. Please try again.