1754014 Members
5743 Online
108811 Solutions
New Discussion юеВ

Re: script to move files

 
SOLVED
Go to solution
Dennis Handly
Acclaimed Contributor

Re: script to move files

# echo scp -p $(< file_list)
syntax error: `(' unexpected

Then use quotes: echo "scp -p $(< file_list)"

># echo $SHELL

This only works if you don't invoke a different shell.
Try: ps -fp $$
NDO
Super Advisor

Re: script to move files

Sorry Dennis!

I am lost:

root@nrtrde2 # ls file_list
file_list
root@nrtrde2 # echo "scp -p $(< file_list)"
scp -p $(< file_list)
root@nrtrde2 # ps -fp $$
UID PID PPID C STIME TTY TIME CMD
root 23099 23097 0 12:22:01 pts/1 0:00 -sh
root@nrtrde2 #


the echo just yields that


regards

F.R.
Dennis Handly
Acclaimed Contributor

Re: script to move files

What HP-UX version are you on?
After you type escape in your real shell, what version does control-V show?

When I do that echo:
$ echo "scp -p $(< file_list)"
sh: file_list: Cannot find or open the file.

(Because I don't have file.)

About the only way that echo can produce that output is if the file "file_list" contains the string:
$(< file_list)
NDO
Super Advisor

Re: script to move files

Hi James & Dennis


Its now working fine, what I did was to use as a second marker as file (/tmp/ref3) file with a much shorter period of time 201104052359.

Files are now being sent to the other server, but I will have create several chunks of markers in order to send all the April files.

Thank you for your help


regards

Fernando
James R. Ferguson
Acclaimed Contributor

Re: script to move files

Hi (again) Fernando:

> Thank you for your help

If you are satisfied with the help that you received, please read the following about assigning points:

http://h30499.www3.hp.com/t5/help/faqpage/faq-category-id/kudos#kudos


Regards!

...JRF..

NDO
Super Advisor

Re: script to move files

Yes James, I always assign points to everybody, but just one more query.

I did run the those comands on the prompt. If I put those on a script will it work?


regards


Fernando
James R. Ferguson
Acclaimed Contributor
Solution

Re: script to move files

Hi (again) Fernando:

> I did run the those comands on the prompt. If I put those on a script will it work?

Yes. However, if you plan to run your script from a 'crontask' remember that 'cron' establishes a minimal environment. In particular, any environmental variables that are in your 'profile's will be missing. Plan ahead accordingly, of course. See the manpages for 'crontab' for more information.

Regards!

...JRF...
NDO
Super Advisor

Re: script to move files

Thank you all, I have already assign points.