views:

23

answers:

1

Shell script is not accepting a directory (D drive) on a windows machine.

$ ./XXXZZ.sh /d/metrics/ABClogs/QWE_ASD_ZXC-030310.zip : No such file or directorymetrics/bin/stddefs.sh

The file is there in that path, infact. Don't know why it is not able to see the 'D' drive. Can some please suggest me in this regard?

A: 

How are you accessing a Windows drive through a shell script? Are you running something like Cygwin and accessing the local machine or are you accessing a remote Windows machine through Samba (or similar)?

Given how your error message looks mashed together, my first thought was that your slashes aren't being interpreted correctly (remember Windows slashes lean the other direction). Try escaping your slashes by changing / to // and see what happens.

On the other hand, the path that it looks like the error is complaining about looks like a path to a script (possibly one included by yours) and not your path to the zipfile. Make sure that the file metrics/bin/stddefs.sh exists and if it does, check your slashes inside your scripts.

bta
Here are few more details on my issue -1. The XXXZZ.sh in refining the info that is in the zip file.2. To do that, the above script is reading one standard definitions file 'stddefs.sh (in /d/metrics/bin).3. First few lines in the script '/XXXZZ.sh' are -#!/bin/sh## This is the connect data file processing###Main#include the definitions. //d/metrics/bin/idrstddefs.shFILE=$14. I'm using all the scripting in 'Cygwin'window.
Bapu
@Bapu: please edit your question and add that info to it. Besides being useful information for anyone trying to answer this, the formatting limitations of comments destroyed your script's layout.
bta
@Bapu: If you are doing this within cygwin, use the syntax `/cygdrive/d/folder` instead of `/d/folder`.
bta