how i can pass a file directory (path) as parameter to
- batch file in windows operating system
- bash file in unix operating system
To pass a directory to a windows batch file you put it on the command line of the batch file. When working with paths it is a good thing to put "" around them as they may contain spaces etc e.g.
to reference the command line arguments in your batch file use
If for example you had a simple batch file (c:\temp\b.bat) like this
and you called it as above, you would get a directory listing of c:\program files.
I'm going to guess now that what you want to do is pass a windows path to a unix script and then get the unix script to run a batch file on windows and pass the windows path supplied to the windows batch file.
Similarly to windows you pass the arguments to a bash script on the command line. You need to enclose the path in "". bash will attempt to interpret any special characters in your command line arguments so you need to enclose the path argument in '' too e.g.
To reference the command line arguments in bash use
If your bash script was
then you would get a directory listing of c:\program files and 3 would be returned to $?.