Unable to assign an array in rc.local
I have the following line in my rc.local file:
Code:
USB=( `/usr/bin/file /sys/block/sda | /bin/egrep -o 'usb.*' | /usr/bin/awk -F"/" '{print $1, $2, $3}'` ) Code:
echo `/usr/bin/file /sys/block/sda | /bin/egrep -o 'usb.*' | /usr/bin/awk -F"/" '{print $1, $2, $3}'` >> /root/aaa Any idea what's happening and how can I solve this? The server is running Debian Wheezy x64. |
Well I found this with a bit of searching:
Quote:
Code:
$ cat test.sh Code:
$ cat test.sh |
Well, my test.sh has no errors ;-). But the same code in rc.local fails. I use the resulting array in a for loop, is there an alternative for it?
|
Quote:
Quote:
|
Oh, my test file was using bash. Hmm.
Anyway, problem solved: I've learned that a for loop don't need an array, so now everything is working as it should've. Thanks for the help. |
All times are GMT -5. The time now is 02:50 AM. |