Bash with Special Characters not copying
Hi guys, need your help on this got a script that read files and put the it into a variable but the path has a special character "#" and therefore not copying.
Any help is greatly appreciated. Thank you. Quote:
|
Have you tried anything like
Code:
cp "/usr/dfiles/$line/Tasks/"'#msgs'"/*.eml" "/mnt/NAS/Tasks1/$line/" I forgot to ask, have you verified that the files *.emp exist in those folders? |
Is the msgs folder the only sub folder of Tasks? If so: try to copy the path manually, use tab completion. Not only will bash complete the name, but it will do so while properly escaping it, so you can take note of what you yourself need to do to copy that folder's contents.
|
Quote:
I tried the method you give, no joy. Thanks. |
Quote:
|
Maybe this helps.
|
Quote:
|
Do some testing to determine if source (as you seem to presume) is actually the problem.
Do all those "$line" directory levels exist at the target ?. |
I suggest you to add set -xv at the beginning of your script and you will see what's happening. It will not fix itself, just will give you debug info. Probably helps...
|
Hi guys, thanks for all the replies never had the time to troubleshoot or try something. The deadline was approaching, to get the thing done I did it for 6 hours.
|
Quote:
Admire your dedication, but when you have time I would play with the tools to ensure you know ways to get it done quicker in the future. I am trying to think of anything I do for 6 hours since I left the military, and got nothing. Even sleep is in shifts, and I rarely get 6 hours. Wow. |
Can you try this:
Code:
cp /usr/dfiles/$line/Tasks/'?msgs'/*.eml" "/mnt/NAS/Tasks1/$line/" Code:
cp /usr/dfiles/$line/Tasks/*msgs/*.eml "/mnt/NAS/Tasks1/$line/" |
Quote:
|
"no joy" is not a usable answer. It does not give any information about what did you really try, what's happened, what was the result, what went wrong - therefore we cannot give you any hint, just this one: "better luck next time".
Have you tried already set -xv? |
Quote:
Anyhow, I spotted one mistake with my post. I left an extra " there. How about this: Code:
cp /usr/dfiles/$line/Tasks/'?msgs'/*.eml /mnt/NAS/Tasks1/$line/ |
All times are GMT -5. The time now is 03:02 AM. |