LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   convert dos2unix /opt/SV DC/*.* using system command.Here path is having space. (https://www.linuxquestions.org/questions/linux-newbie-8/convert-dos2unix-opt-sv-dc-%2A-%2A-using-system-command-here-path-is-having-space-745516/)

nagendrar 08-06-2009 04:34 AM

convert dos2unix /opt/SV DC/*.* using system command.Here path is having space.
 
I want to convert dos2unix all files like *.* using system command.
Here path is having the space.

ex:

char filePath[1024];
memset(filePath, 0, 1024);
_snprintf(filePath,1023,"/usr/bin/dos2unix \"/opt/SV DC/options/*.*\"");
system(filePath);

please give suggestions to solve problem.

ThanQ,
Nagendra R

nagendrar 08-06-2009 05:27 AM

I got the solution as:


char filePath[1024];
memset(filePath, 0, 1024);
_snprintf(filePath,1023,"/usr/bin/dos2unix \"/opt/SV DC/options\"/*.*");
system(filePath);

Here string quotation(") is added before *.*.

ThanQ,
Nagendra R


All times are GMT -5. The time now is 03:23 PM.