Topic "Command-linewith inclusion and exclusion mask"

Author Message
jtallent

Guest


Hi!
I'm trying to issue the following command (assume I'm already connected):

mv ??????-??.TXT|0911??-??.TXT archive/

the command waits a few seconds then returns to the prompt but does nothing. Basically what I'm trying to do is move all files having the above pattern EXCEPT for those files starting with 0911. The files are named YYMMDD-EC.TXT and YYMMDD-CC.TXT where YYMMDD is a date. The documentation says that I can specify an exclude mask by appending it to the include mask. Doing so does not seem to do anything. A better explanation (or better yet a real example on the documentation page) would be ideal. Thanks!
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
It is actually not possible to combine masks this way in this context. I'll update the documentation.
_________________
Martin Prikryl
Pedrodude

Guest


prikryl wrote:
It is actually not possible to combine masks this way in this context. I'll update the documentation.


The filemask switch is really useful and it would be great if this could be implemented into the move command for just this sort of situation. My need is very similar: I'd like to be able to archive all files in a folder to a subfolder and I'm obviously getting the error code 2 as this bit of my script:
Code:
mv *.* Processed/

tries to copy the "Processed" folder into itself...

Unless there's a clever workaround I've missed!

Otherwise, as this is my first post, thank you so much for your excellent application!

Regards,

P
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
Pedrodude wrote:
Unless there's a clever workaround I've missed!

Note the files to subfolder in temp folder and than move the whole folder to the original folder.
_________________
Martin Prikryl
pedrodude

Guest


prikryl wrote:
Pedrodude wrote:
Unless there's a clever workaround I've missed!

Note the files to subfolder in temp folder and than move the whole folder to the original folder.


Thanks, I suppose that would work. But it does seem like something that a filemask in mv would solve more neatly (I can see situations where one might not have "create new folder" permissions on the remote location). Is this something likely to appear in a future version?

Regards
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License