0
I'm trying to write a script in tcsh that will copy select files that I specify at the command line from one directory to another without having to write out the entire path of each file.
Also, to help clarify, say for example I have 30 of these files in a single directory, all with nearly identical names but I only want 4 of the files to be copied (i.e. I don't think a wildcard could be used here).
As one last note, I'm very new to Unix so any "dumbed down" suggestions on how to write this script are greatly appreciated!
Thanks for your quick response.
I tried what you said and the first file was copied just fine but the second gave this error
cp: cannot stat `testing_2': No such file or directory"
(but I know the file exists).
This is what I'm working with...
#!/bin/tcsh
set raw_files="/infinite1/incoming/$*"
foreach files ($raw_files) echo "Copying "
basename $raw_files
"..." cp -r "$files" "/infinite1/infinite/analyses_Kresub/" echo ""basename $raw_files
" copied successfully" end – David – 2013-05-13T18:13:25.843also...sorry about the horrible formatting – David – 2013-05-13T18:19:30.540