|
|
A script to ease scp for files with odd names
scp-to-coppit.org File with weird char's.txtNo, you can't. Not in the shell anyway, since it will look for the closing quote and not include the quotes in the text. In this case, the shell will simply give you the secondary prompt and wait until you've typed another quote or escaped your way out (^G, ^C). And if you've typed the second quote, the error is most likely going to be "file not found". According to me, by I'm a command line user since the early 80's, it's much easier and safer to use the built in completion, e.g. using the tab key. Suppose my directory contains these three files
Then typing
will show
because that's the unique starting part. The choice has now boiled down to the first two files. At that point, typing w and another TAB will fill in the entiry name, resulting in
an you're ready to type the destination. Or you could make the script with the destination in it, but without the weird and potentially dangerous argument mangling. And it is dangerous, since the arguments are joined with single spaces and thus (under bizarre circumstances admittedly (*)) you could be overwriting an unwanted file at the destination. (*) Think of file names with more than one consecutive space and differing with another file in only the spaces, not to mention files with backslashes in their name...
A script to ease scp for files with odd names
Then how to do batch scp transfers, e.g. "scp *.txt" and the like? Tab-completion won't work in those cases.
A script to ease scp for files with odd names
That's true, but the original script doesn't do that either: if you type a * in calling, it will be expanded to contain all files in the directory. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|