Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Yes, the * mask and the current directory are implicit, but the source parameter must be specified. So ./, * and ./* all mean the same.

Thanks for the input. I simply didn't realize I could put just the exception in the -filemask criteria (your first example).
In your second example, does the ./ simply mean all files in the current directory? I just wanted to confirm because, again, I was not familiar with this type of syntax.

OK, but still, the *.zip in the -filemask redundant. It's enough to do:
get -filemask=|* *.zip "X:\Output\"

get -filemask=*.zip|* ./ "X:\Output\"

You are correct, for the example data I gave. I didn't spend enough time to properly demonstrate the files that were in the source. Instead of two files, my source actually has numerous files and I need to exclude only one of them. So, this might be a better example:

Assume my source directory contains multiple files, such as:,,,,, . . .,,

Now, I only want to exclude all files that end in "2". To do that, my get command would look like the following:
get -filemask=*.zip|* *.zip "X:\Output\"

While this works, it seems unnecessarily complicated.
What about just:
get filea*.zip "X:\Output\"

In case anyone reads this, I want to mention that I found my issue. This was my original "get" command:
get -filemask=filea*.zip|filex* "X:\Output\"

I was missing my source argument. So, my working command looks like the following:
get -filemask=filea*.zip|filex* *.zip "X:\Output\"

Script Problem with Get and Filemask

I have a script file that has been working great as long as I am simply using a wildcard to get all of the files from a directory and placing them in the directory I specify. For my examples, assume the source directory contains two files: and My command looks like the following:
get *.zip "X:\Output\"

(X:\Output is simply a local directory on my computer.)

Now, I need to modify this to use a -filemask switch so I can exclude one of the files. I have tried numerous methods of writing the "get" command and I always get an error saying:
Can't get attributes of file 'X:\Output',

No such file or directory.
Error code: 2

Here is a (failing) example of what I have tried:
get -filemask=filea*.zip|filex* "X:\Output\"

Just for further clarification, here is what my entire script looks like:
option batch abort
option confirm off
open sftp://<connection info>
cd /public/mydir
get -filemask=filea*.zip|filex* "X:\Output\"

I am only showing one example of what I have tried. Believe me, I have setup the command, and the script, in multiple forms, using ideas I have been finding on this forum, but with no luck. Can anyone tell me why I cannot get this to work?