LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Shell script to read from csv file (https://www.linuxquestions.org/questions/programming-9/shell-script-to-read-from-csv-file-180496/)

hendemeg 05-11-2004 08:09 PM

Shell script to read from csv file
 
Hi All,

I'm new to scripting and would like some help with the following.

What I want to do is read in from a csv file with a list of mqseries queues and turn the trigger functionality 'off'. The queues to turn the trigger off will change daily, but the structure of the file will be the same (ie: only contain queue names).

----------------------------------
Sample contents of csv

QL.1.TEST, QL.2.TEST, QL.2.TEST

--------------------------------
From this, I've got the below code to turn the trigger off, but don't know how to replace the ${QUEUE_FILE} variable to read from a CSV file and not just the variable I enter on the command line.


function trigger_queue {
set $x
action=${1}
for i in 'echo "ALTER QLOCAL (${QUEUE_FILE}) ${action} " | runmqsc > /dev/null'
do
echo 'Queue is ${i}'
done



Any help would be appreciated :-)

Thanks,
Megan

leonscape 05-11-2004 08:23 PM

Check the Bash Advanced Scripting Guide specifically I/O redirection.


All times are GMT -5. The time now is 04:42 PM.