This code does 3 things is cshell. It changes the SES_ID_INPUT, OUTPUT_FILE_NAME, and test text in an sql file prior to running it. So far I been unsuccessful in trying to trim this down into one statement.
cat gen_query.sql | sed 's/ SI'/SES_ID_INPUT/'$SES_ID'/'>junk
cat junk | sed 's/OUTPUT_FILE_NAME/'$NAME'/'>junk2
cat junk2 | sed 's/test/'$NAME'/'> $NAME.sql
I tried this
cat gen_query.sql | sed 's/ SI'/SES_ID_INPUT/'$SES_ID'/',sed 's/OUTPUT_FILE_NAME/'$NAME'/'>junk
hoping I could combine the two. I just don't like creating two files in order to get a third. Its like wearing socks in the bathtub, it just aint right. Any suggestions?
Greg
cat gen_query.sql | sed 's/ SI'/SES_ID_INPUT/'$SES_ID'/'>junk
cat junk | sed 's/OUTPUT_FILE_NAME/'$NAME'/'>junk2
cat junk2 | sed 's/test/'$NAME'/'> $NAME.sql
I tried this
cat gen_query.sql | sed 's/ SI'/SES_ID_INPUT/'$SES_ID'/',sed 's/OUTPUT_FILE_NAME/'$NAME'/'>junk
hoping I could combine the two. I just don't like creating two files in order to get a third. Its like wearing socks in the bathtub, it just aint right. Any suggestions?
Greg