bash - Use variables with dot in unix shell script -


how use variables dot in unix (bash) shell script? have script below:

#!/bin/bash set -x "file=system.properties" file=$1 echo $1 if [ -f "$file" ];    echo "file $file exists" else    echo "file $file not exist" fi 

this need ⟶ x=propertyfile, , propertyfile=$1. can please me?

you can't declare variable names dots can use associative arrays map keys, more appropriate solution. requires bash 4.0.

declare -a file                      ## declare variable associative array. file[system.properties]="somefile"   ## assign value. echo "${file[system.properties]}"    ## access value. 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -