Skip to content

Instantly share code, notes, and snippets.

@j-mcc1993
Created June 27, 2014 05:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j-mcc1993/9716d5586b8940eb3b16 to your computer and use it in GitHub Desktop.
Save j-mcc1993/9716d5586b8940eb3b16 to your computer and use it in GitHub Desktop.
Short Shell Script that runs expect script to grab Ephemeris data and stores output into files with unique names.
#!/bin/sh
EPHEMFILE=Ephem_Data_$(date "+%Y-%m-%d|%H-%M-%S").txt
OUTFILE=Output_$(date "+%Y-%m-%d|%H-%M-%S").txt
./expect_ftp.sh >/dev/null
READ=$(ls|grep .*\.15)
cat $READ > $OUTFILE
cat $OUTFILE | sed -n '/$$SOE/,/$$EOE/p' | sed -e 's/\$.*//' -e '/^$/ d' > $EPHEMFILE
cat "$EPHEMFILE"
rm $READ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment