Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 05-11-2004, 08:09 PM   #1
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


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
for i in 'echo "ALTER QLOCAL (${QUEUE_FILE}) ${action} " | runmqsc > /dev/null'
echo 'Queue is ${i}'

Any help would be appreciated :-)

Old 05-11-2004, 08:23 PM   #2
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:58 PM.

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