How do you overwrite a directory with another directory? I know you can delete your directory then copy your directory over, but I would think there would be a way to do this in one step.
Actually it will work only if dir2 IS empty
But when there are some files in it, it simply won't work...
So for now, I don't have any solution better than:
I think, that filesystem won't allow to do such thing with simple 'mv'.
I think, that filesystem won't allow to do such thing with simple 'mv'.
True.
When source and destination are both directory names, the destination for "mv" is relative to the target directory. If the target directory does not exist "mv" will create it, otherwise "mv" will create the new directory under the target directory.
Hello All,
I had just a question about my Bash Script I'm currently writing.
The script I have writes some text to a output file. After I write to the output file I send the file to another server to do
some stuff with it.
After the file sends in the script, I don't need the output/txt... (4 Replies)
my script is:
awk '...mycode...' file1.txt > file2.txt
and i want to overwrite file2.txt eachtime I run this script. but it says:File exists! :( I have tried
awk '...mycode...' file1.txt >| file2.txt but it again says:Missing name for redirect! :confused::confused:
what is this? (2 Replies)
Hi guys,
I checked the knowledge base before posting this question.
is there any way by which you can ALWAYS ALLOW file overwrite in AWK?. i.e. an option similar to noclobber in Korn shell.
I don't to check for files existence and remove them. (1 Reply)
Hi
im using the following to copy a file to a directory, the user being prompted to overwrite if the file already exists in that directory,
cp -i myfile /home/brief/bin2
but this reveals the path of the directory when being prompted to overwrite (below)
cp: overwrite... (2 Replies)