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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -