bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cp command will copy to subdirectory without appending /


From: Todd Partridge
Subject: cp command will copy to subdirectory without appending /
Date: Mon, 19 Oct 2009 06:33:10 -0500

The cp command will copy to a subdirectory without an appending /

mkdir test test2
touch abc test
touch bcd test2
cp -R test2 test
ls test
test2 abc

Since the cp command can also rename I think the proper behavior here
for 'cp -R test2 test' would be to error and print that 'Folder
already exists'.  Appending a / would imply the directory:

cp -R test2 test/

This usage will remove the ambiguity of the command between the copy
function and the rename function.

-- 
When in trouble or in doubt run in circles, scream and shout. - Robert
A. Heinlein
My Linux Blog - http://linuxtidbits.wordpress.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]