LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 09: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, 09:23 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

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


Reply


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 51 07-04-2013 09:16 PM
[Shell] Read a File from script yussef Programming 4 08-19-2008 05:26 AM
shell script that read each line separatly xpucto Programming 6 09-20-2005 09:06 AM
C++ read csv file row into vector taban1 Programming 3 11-08-2004 03:01 PM
How to read ans parse MS word file using a Linux Shell script. Alek Linux - General 2 11-10-2003 03:07 PM


All times are GMT -5. The time now is 06:54 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration