Sponsored Content
Top Forums Shell Programming and Scripting Passing three variables to loop and error Post 302919123 by Daniel Gate on Sunday 28th of September 2014 09:38:17 AM
Old 09-28-2014
RudiC & Corona688,

It works charming except one error:

HTML Code:
0782-310 Usage:
        mkvirprt -A AttachmentType
        mkvirprt [ -A AttachmentType ] -d QueueDevice -n Device
         -q PrintQueue -s DataStream -t PrinterType [ -T ]
        Use 'smit mkvirprt' to use it interactively.

dspmsg: 1312-042 Invalid argument index in message.  May need
more arguments on the command line.
The script runs fine for the ones having three columns defined in the feed file
HTML Code:
cat printfeed
emg1  emg1ps  emgj1
emg2  emg2ps  emgj2
..... snipped .....
zeba                  zeba
emr12               emr12
..... snipped .....
(note)  the second column can be empty
But, the ones with empty second column returns the error above.

I think I need to modify the feed file with delimiter (pipe -- |):

HTML Code:
cat printfeed
emg1 | emg1ps | emgj1
emg2 | emg2ps | emgj2
..... snipped .....
zeba   |  |               zeba
emr12  |   |          emr12
..... snipped .....
(note)  the second column can be empty
With the delimiter in place for the feed file, please let me know how to make it run..

I tried this, but not working ....

Code:
while read q1 q3 q5
  do [ "$q5" ] || { q5=$q4; q4=""; }
     /usr/lib/lpd/pio/etc/piomkjetd mkpq_jetdirect -p 'hplj-4000' -D pcl -q "$q1" -D ps -q "$q3" -h "$q5" -x '9100'   
  done <printfeed

Please advise.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

passing variables

Hi, Is there any way to pass variable to a sed script.For awk we have -v option.like that do we have any way to pass variable to a sed script from a awk script or from normal script? Thanx, sounder (1 Reply)
Discussion started by: sounder123
1 Replies

2. Shell Programming and Scripting

Passing variables to sed

Hi folks, I'm looking for a solution to pass variables to a sed-command. I'm reading a lot of threats and also the q&a "How can I use a variable in sed?". None of these commands works. I'm using AIX 5.2. I want to do the following: NUMBER=` echo 38341` | sed -n '/$NUMBER/p' an obtained... (3 Replies)
Discussion started by: jfisch
3 Replies

3. UNIX for Dummies Questions & Answers

Passing variables between scripts...

Hey all, I'm wondering how you pass variable's that are defined in one script to another script that's been called by that first script..... Best regards, Jaz (1 Reply)
Discussion started by: Jazmania
1 Replies

4. Shell Programming and Scripting

Using variables created sequentially in a loop while still inside of the loop [bash]

I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends. As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

5. Shell Programming and Scripting

Passing 2 variables

Hi All, I need to pass 2 variables name 'vamskt' and 'vamsi'. Here is my question: delete from gpi.usergroup where usg_user_id in ('vamskt'); delete from gpi.userroles where uro_user_id in ('vamskt'); delete from gpi.user where usr_id in ('vamskt'); insert into gpi.user... (3 Replies)
Discussion started by: tvamsikiran
3 Replies

6. Shell Programming and Scripting

Reading a string and passing passing arguments to a while loop

I have an for loop that reads the following file cat param.cfg val1:env1:opt1 val2:env2:opt2 val3:env3:opt3 val4:env4:opt4 . . The for loop extracts the each line of the file so that at any one point, the value of i is val1:env1:opt1 etc... I would like to extract each... (19 Replies)
Discussion started by: goddevil
19 Replies

7. Shell Programming and Scripting

Passing Variables

I have below data: DAY1=10202013 I am trying below but not getting the desired output: COUNT=1 DATE=DAY$COUNT echo "Date is $DATE" However output I am getting is: Date is DAY1 I wanted the output as: Date is 10202013 I tried following as well: DAY1=10202013 COUNT=1... (3 Replies)
Discussion started by: rockyr1985
3 Replies

8. Shell Programming and Scripting

Passing awk variables to bash variables

Trying to do so echo "111:222:333" |awk -F: '{system("export TESTO=" $2)}'But it doesn't work (2 Replies)
Discussion started by: urello
2 Replies

9. UNIX for Dummies Questions & Answers

Passing variables to mkuser

In a ksh, I'm attempting to pass my string of arguments to the mkuser command in a variable as follows... cmd="pgrp=ACRGENU groups=ACRGENU home=/home/${USERID} shell=/usr/bin/ksh" cmd=$cmd" gecos='${USERNAME}' login=true su=false rlogin=true daemon=true" cmd=$cmd" admin=false... (4 Replies)
Discussion started by: bubbawuzhere
4 Replies

10. Shell Programming and Scripting

ksh While Loop - passing variables to functions

I'm reading a text file using a while loop but when I call a function from within this loop it exits that same iteration … even though there are many more lines in the file to be read. I thought it was something to do with the IFS setting but it appears that a function call (when run... (3 Replies)
Discussion started by: user052009
3 Replies
HTML::Microformats::Format::hEntry(3pm) 		User Contributed Perl Documentation		   HTML::Microformats::Format::hEntry(3pm)

NAME
HTML::Microformats::Format::hEntry - an hAtom entry SYNOPSIS
use Data::Dumper; use HTML::Microformats::DocumentContext; use HTML::Microformats::Format::hAtom; my $context = HTML::Microformats::DocumentContext->new($dom, $uri); my @feeds = HTML::Microformats::Format::hAtom->extract_all( $dom->documentElement, $context); foreach my $feed (@feeds) { foreach my $entry ($feed->get_entry) { print $entry->get_link . " "; } } DESCRIPTION
HTML::Microformats::Format::hEntry is a helper module for HTML::Microformats::Format::hAtom. This class is used to represent entries within feeds. Generally speaking, you want to use HTML::Microformats::Format::hAtom instead. HTML::Microformats::Format::hEntry inherits from HTML::Microformats::Format. See the base class definition for a description of property getter/setter methods, constructors, etc. Additional Method o "to_atom" This method exports the data as an XML file containing an Atom <entry>. It requires XML::Atom::FromOWL to work, and will throw an error at run-time if it's not available. o "to_icalendar" This method exports the data in iCalendar format (as a VJOURNAL). It requires RDF::iCalendar to work, and will throw an error at run- time if it's not available. BUGS
Please report any bugs to <http://rt.cpan.org/>. SEE ALSO
HTML::Microformats::Format, HTML::Microformats, HTML::Microformats::Format::hAtom, HTML::Microformats::Format::hNews. AUTHOR
Toby Inkster <tobyink@cpan.org>. COPYRIGHT
Copyright 2008-2011 Toby Inkster This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. perl v5.14.2 2011-12-06 HTML::Microformats::Format::hEntry(3pm)
All times are GMT -4. The time now is 01:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy