LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-11-2004, 08:09 PM   #1
hendemeg
LQ Newbie
 
Registered: May 2004
Posts: 1

Rep: Reputation: 0
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
 
Old 05-11-2004, 08:23 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
Check the Bash Advanced Scripting Guide specifically I/O redirection.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash shell script read file line by line. Darren[UoW] Programming 57 04-17-2016 06:07 PM
[Shell] Read a File from script yussef Programming 4 08-19-2008 04:26 AM
shell script that read each line separatly xpucto Programming 6 09-20-2005 08:06 AM
C++ read csv file row into vector taban1 Programming 3 11-08-2004 02:01 PM
How to read ans parse MS word file using a Linux Shell script. Alek Linux - General 2 11-10-2003 02:07 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration