New answers tagged

0

You can parse it directly using the bash shell's built-in read function, by setting the field separator to = while IFS== read -r name value; do arr1+=("$name") arr2+=("$value") done < model.conf The arrays will be zero indexed by default, i.e. $ echo "${arr1[0]}" customer $ echo "${arr2[0]}" "airtel" Since variables (including arrays) have ...


0

With awk: eval $(awk -F= -v i=0 '{print "arr1["i"]="$1";arr2["i"]="$2;i++}' model.conf) With = as field seperator and variable i with initial value 0, awk will print "arr1["i"]="$1";arr2["i"]="$2 for each line where $1 will have the key and $1 will have the value and increment i for each line. awk -F= -v i=0 '{print "arr1["i"]="$1";arr2["i"]="$2;i++}' ...


0

$ /sbin/mkfs.ext4 test1 mke2fs 1.42.12 (29-Aug-2014) Discarding device blocks: done [...] Now there's a hint. Let's see what the manual says: -E extended-options discard Attempt to discard blocks at mkfs time (discarding blocks initially is useful on solid state devices and sparse / thin-provisioned storage). When the device advertises that ...



Top 50 recent answers are included