I have below script which turns on the tether mode on my intel edison. But when I entered password with space it shows error that argument list is long. Without space it works perfectly fine
#!/usr/bin/env bash
SSID_FILE="/usr/share/apache2/htdocs/userhotspotname.conf"
if [ -s "$SSID_FILE" ]
then
filename="/usr/share/apache2/htdocs/userhotspotname.conf"
while IFS= read -r line; do
if [[ $line == hotspotna* ]] ; then
name=$(echo $line | grep "hotspotname" | cut -d= -f2)
fi
if [[ $line == hotspotpa* ]] ; then
pass=$(echo $line | grep "hotspotpass" | cut -d= -f2)
#pass="'${pass}'"
echo $pass
fi
done < "$filename"
**connmanctl tether wifi on "${name}" ${pass}**
fi
Below is userhotspotname.conf file content
hotspotname=cvg_space
hotspotpass=cgoma pwd space
Since password is with space connmanctl tether wifi on "${name}" ${pass} This command is failing since it is considering it as 4 arguments. Please help in this if anyone has idea.