Thread: blank space in directory name giving errors
hi have many directories have blank space in names.i have scripts run on them.
here example script
upon executing above script errorcode:#!/bin/bash docid='/home/deel/pdf/rant/spr 2008 shree rose visheshank' p=1 while [ $p -lt 117 ]; cp $docid/$p.pdf ./ p=$p+1 done
what changes suggest can take blank space in directory names.i have tried using double quotes "" results same.code:cp: cannot stat `/home/deel/pdf/rant/spr': no such file or directory cp: cannot stat `2008': no such file or directory cp: cannot stat `shree': no such file or directory cp: cannot stat `rose': no such file or directory cp: cannot stat `visheshank/1.pdf': no such file or directory ./d2.sh: line 5: [: 1+1: integer expression expected
check out bashfaq 020 , bashpitfalls 002 (links in signature) , http://mywiki.wooledge.org/arithmeticexpression.
code:#!/bin/bash docid='/home/deel/pdf/rant/spr 2008 shree rose visheshank' p=1 while (( p < 117 )); cp -- "$docid/$p.pdf" ./ ((p++)) done
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk blank space in directory name giving errors
Ubuntu
Comments
Post a Comment