i want to write a shell script
cd /dev
for hdd in sd*; do
[ -f "$hdd" ] || continue
status_$hdd=$(my_def_get_hddstaus "$hdd") #my_def_get_hddstaus returns OK or FAIL randomly just to test
done
i get error like
status_sda0=OK: command not found
status_sda1=FAIL: command not found
I want to record the value OK or Fail into these variable, I am using bash, what I am doing wrong.
if I write status_sda0=OK
in shell it record OK into status_sda0
I found in reference too eval "echo "$filemsg$word1""
Thanks again
– kdm6389 Oct 29 '17 at 13:49