-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmake_get_files_script.csh
More file actions
executable file
·50 lines (43 loc) · 1.98 KB
/
make_get_files_script.csh
File metadata and controls
executable file
·50 lines (43 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/tcsh
#----------------------------------------------------------------------
# Purpose:
# To parse the log files (*.log) produced by the HELP_tap_irsa.csh script and build
# a script to retrive the files from IRSA
#----------------------------------------------------------------------
# Parameters
# None
#----------------------------------------------------------------------
# How to Improve:
# might be worth being able to name the output script file and
# selecting specific files, rather than just *.log
# for elegance I could put the begining/end of command into the awk
# command rather than as separate echos, but no added value!
#----------------------------------------------------------------------
# Author(s):
# Seb Oliver (University of Sussex)
#----------------------------------------------------------------------
# Date:
# 29th November 2015 (tested with commented header)
#----------------------------------------------------------------------
# Acknowledgement:
# This script was produced as part of the Herschel Extragalactic
# Legacy Project: HELP, funded by EU....
#----------------------------------------------------------------------
# end of header
#----------------------------------------------------------------------
# clean up old versions of the script and put some header information in
#rm get_irsa_files.csh
echo '#\!/bin/bash' > get_irsa_files.csh
echo '# this script automatically generated by make_get_files_script.csh' >> get_irsa_files.csh
# loop round each .log file
foreach i (*.log)
# begining bit of the curl command
echo -n "curl -o" $i:r.fits "-v http://irsa.ipac.caltech.edu:80/TAP/async/" >> get_irsa_files.csh
# stripping out the relevant code from the .log file
grep Location $i | awk 'BEGIN { FS = "/"; ORS =""; OFS=""} ; {print $6} ' >> get_irsa_files.csh
# putting on the end bit of the curl commnad
echo "/results/result" >> get_irsa_files.csh
end
# fix up the control characters in the script
sed
exit