I am trying to develop a nautilus script which read selected filepath and en-queue in vlc player. Problem is if filename is space separated then we need to add extra '\' in file name. But when i run the vlc with filename, vlc can not read file.
When run in terminal:
vlc --playlist-enqueue filename\ space\ name.extension
it just works well
but when i try to give same command from bash file then vlc can not read file. My script works for non-space filename. What is the problem? Please help. At least give resource. I googled but can not find suitable solution.
Thanks in advance
Edited : my script
#!/bin/sh path=$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS result="" cnt=0 for i in $path do if [ $cnt -eq 0 ] then result=$i else result=$result'\ '$i fi cnt=`expr $cnt + 1` done #vlc --playlist-enqueue "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" vlc --playlist-enqueue "$result"