In my program I have to use the diff
command from SUA to find out the difference of 2 files.
I use the a command as follows,
diff xx yy
here
xx - /a/s/xx.txt
yy - /a/s/yy/txt
The path of xx.txt
and yy.txt
is in Windows format. But in SUA 'diff' command accepts the path in UNIX format as /dev/fs/C/a/s/xx.txt
and /dev/fs/C/a/s/yy.txt
.
We have a command winpath2unix
that will convert the path into Unix format. So I want to use the diff
command as follows in my program,
diff 'winpath2unix xx' 'winpath2unix yy'
Here I want to run winpath2unix
command first and need to pass the output of these commands to diff
command.
In C shell it is working fine. But in the command prompt its not working.
Is there any option to run this command?
Or how can i use csh
in CreateProcess?
If by the command prompt, you mean
cmd.exe
, there is a trick that can help you which uses theFOR
command to set a variable in a batch file. So you would create a batch file that looked something like thisIf we called this batch file
doDiff.bat
, you would call it with the syntaxdoDiff.bat xx yy
.Another description of this technique is here. Raymond Chen also demonstrates a similar technique here. The official documentation lives on MSDN under the header Iterating and file parsing.