Win2000 Gawk Renaming a file with system() command, command line to long 
Author Message
 Win2000 Gawk Renaming a file with system() command, command line to long

"Command line to long" is a Win2000 error message. 125 characters MAX
on line.
Some of the file names are quite long, that are in use.
http://www.*-*-*.com/

I am having a problem renaming a file with spaces in the file name in
Win2000 using the gawk system() command.

The file name with spaces in it, needs to be surrounded in quotes

"file name.ext"

The system() function(?) of gawk keeps complaining no matter how I try
to format the command.

Here is what I am trying to do.

system("cd c:\\www.unitytustin.org\\sndclips")

system("ren " UnReplaced " " Replaced)

I have tried escaping a quote such as the following, and get the
parsing error that "backslash not last character on line"

system("ren \"" UnReplaced \"" " Replaced)

Thank You to anyone who can help

GC



Fri, 08 Jul 2005 14:14:28 GMT  
 Win2000 Gawk Renaming a file with system() command, command line to long

Quote:
> "Command line to long" is a Win2000 error message. 125 characters MAX
> on line.
> Some of the file names are quite long, that are in use.
> http://msdn.microsoft.com/library/en-us/w2kmsgs/3559.asp

ISTR that this can be changed in Win2000.  Try cmd /? in a "DOS" window
to see if that helps, otherwise try posting to alt.msdos.batch.nt - the
gurus there ought to be able to help.

Quote:
> I am having a problem renaming a file with spaces in the file name in
> Win2000 using the gawk system() command.

> The file name with spaces in it, needs to be surrounded in quotes

> "file name.ext"

> The system() function(?) of gawk keeps complaining no matter how I try
> to format the command.

> Here is what I am trying to do.

> system("cd c:\\www.unitytustin.org\\sndclips")

> system("ren " UnReplaced " " Replaced)

I assume the above two commands are working OK?

Quote:
> I have tried escaping a quote such as the following, and get the
> parsing error that "backslash not last character on line"

> system("ren \"" UnReplaced \"" " Replaced)

You need this instead:

system("ren \"" UnReplaced "\" " Replaced)

i.e., the second \" needs to be inside the quotes, not outside.

Quote:

> Thank You to anyone who can help

> GC

HTH
--
Peter S Tillier
"Who needs perl when you can write dc and sokoban in sed?"


Fri, 08 Jul 2005 14:47:19 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. System commands and command-line args with g77 on Sun

2. OS/2 system command in Rexx command files.

3. gawk 3.1.1/windows command line args problem

4. using system command in gawk

5. How can I ignore long command line

6. command environments and command line arguments

7. Command line variables to executables,command programs

8. long command line in win 9x

9. command line options for old viscob and vclink commands

10. command line command structure representation

11. Fortran command to read command line argument?

12. Obtaining the line reached in a source command without terminating the command

 

 
Powered by phpBB® Forum Software