shell - Invalid filename given bluetooth transfer bash script -
being lazy bum am, i've been trying make simple bash script transfer files com phone. however, when run following script, keep getting "invalid filename given"
for f in *.mp3 bluetooth-sendto --device=<address> ${f} done
anyone can point me in right direction? :)
one of files contains spaces. when don't quote parameter expansions undergo word splitting , globbing. rule of thumb should always quote:
for f in *.mp3; [ -e "$f" ] || continue bluetooth-sendto --device=<address> "$f" done
the reason [ -e "$f" ] || continue
if no files found literal *.mp3
in f
.
Comments
Post a Comment