I want to avoid my script posting an error if I try to cp a file that does not exist. However, I would like error messages to print out for any other error, such as insufficient permissions. This means I can't send the messages to dev/null. what other solutions are there to do this in a script?
One option is an if statement to check if the file exists before copying, but it seems rather cluttered approach. I think I can get what I want by adding an * in the file's name, though it seems an odd way of doing things. is there some command line argument or other way to get what I want?