Why am I getting unbound variable i bash? -


i have following script works part till hits specific line:

#!/usr/bin/env bash  set -eux  # go home. cd /vagrant/freya/  cleaned_assets=false  ## clean time! ## remove vendor , composer.lock folders - because. f in *;   if [[ -d $f ]];     if [[ $f != ".git" ]] && [[ $f != "bin" ]] && [[ $f != "docs" ]];        if [[ $f == "loader" ]] && [[ $cleaned_assets == false ]];         cd "$f/"         if [[ -d "assets" ]];           cd assets/           rm -rf vendor composer.lock docs           let $cleaned_assets=true           cd ../../         fi       fi        cd "$f/"       rm -rf vendor composer.lock docs       cd ../     fi   fi done 

the issue when hits let $cleaned_assets=true not sure proper way set variable true, never enters loop again. keep getting:

+ let false=true bin/clean-directories: line 21: true: unbound variable 

cleaned_assets=true 

no let, no $.

in particular, let causes true treated variable name (searched numeric value), , referring variable names don't exist gets flagged set -u.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -