NIKON directory space in name
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix questions > NIKON directory space in name




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    NIKON directory space in name  
John Eley


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-25-06 01:38 PM

Hi all

I have a CF card in a PCI adapter.
The card is given a name by the camera:

NIKON D70

This is ok from the command line:

ls -l /Volumes/NIKON\ D70
total 32
drwxrwxrwx   1 jeley  jeley  8192 Jan 25 12:14 DCIM


But doesn't seem to work from a script:

#!/bin/sh
SRC='/Volumes/NIKON\ D70/DCIM/100NCD70/'

cp -Rv $SRC $DEST
cp: /Volumes/NIKON: open: No such file or directory
cp: D70/DCIM/100NCD70/: open: No such file or directory

Tried to change the name to replace the space in
NIKON D70 with an underscore without luck:

NEW_NAME=$(ls -1 /Volumes/ | grep 'NIKON' | tr ' ' '_' )
SRC='/Volumes/$NEW_NAME/DCIM/100NCD70/'

is there a way to do this?

John





[ Post a follow-up to this message ]



    Re: NIKON directory space in name  
Stephane Chazelas


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-25-06 01:38 PM

On Wed, 25 Jan 2006 13:38:11 +0100, John Eley wrote:
> Hi all
>
> I have a CF card in a PCI adapter.
> The card is given a name by the camera:
>
> NIKON D70
>
> This is ok from the command line:
>
> ls -l /Volumes/NIKON\ D70
> total 32
> drwxrwxrwx   1 jeley  jeley  8192 Jan 25 12:14 DCIM
>
>
> But doesn't seem to work from a script:
>
> #!/bin/sh
> SRC='/Volumes/NIKON\ D70/DCIM/100NCD70/'
>
> cp -Rv $SRC $DEST

Leaving a variable unquoted has a very special meaning for the
shell. You should never do that unless you know what you're
doing and why.

cp -Rv -- "$SRC" "$DEST"

--
Stephane





[ Post a follow-up to this message ]



    Re: NIKON directory space in name  
Rainer Temme


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-25-06 01:38 PM


Hi John ... try

SRC="/Volumes/NIKON D70/DCIM/100NCD70/"
DST=dest

cp -Rv "$SRC" $DEST

Regards ... Rainer





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:01 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register