A modest attempt to de-dumb scpPosted Wednesday, May 12th 2010 @ 8:37AM
The title of this post isn't entirely fair; scp is an awesome utility, and is probably one of my top 10 typed commands in a given day. (Sadly true, I shuffle files around a lot). Because of how often I use it, however, I do have some long standing issues that have always striked me as just plain silly behavior. flag consistencyscp strives to be consistent with its insecure predecessor, rcp, just like ssh shares many of the same flags as rsh. rcp has been around since 1982, and was largely obsoleted when ssh and friends became available in 1995. Trying to share flags with the original program you're replacing is a noble idea. Unfortunately, there is a single flag that is in conflict between ssh and rcp -- -p. Because scp uses all the same connection rules (user, password, keypair) as ssh, I think it makes more sense to be consistent with ssh -- not rcp, which as of this writing, has been obsoleted for 15 years. As an end user, I shouldn't have to remember that ssh needs a -p to set a remote port, and scp needs a -P. Since ssh doesn't actually use -P for anything, that's where the original rcp "preserve modes" should land. copying local filesscp is for copying files across a network. I don't want it to ever make local copies. If I want a local copy, I'll use cp, thank you very much. How many times have you accidentally omitted the trailing colon on a remote destination, just to end up with a user+host named local copy?
When would you -ever- want that behavior, and want to use scp to do it? Never, I say! Here's what I think is an improvement:
local files validityAnother one when copying local files to remote destinations. scp currently goes through all the work of connecting to the remote host before bothering to check if the local file you're trying to copy even is available.
Why bother?
Rather than helplessly complain about this stuff into the internet abyss, I went ahead and made a quick patch. You get get it here, if you're so inclined. |
archivesjabber statussubscribeplan updates
recently bookmarked |

Comments
Thursday, May 13th 2010 @ 5:45PM
you are a tiny god. many thanks!
Leave a comment