Sponsored Content
Top Forums Shell Programming and Scripting ksh While Loop - passing variables to functions Post 302986413 by MadeInGermany on Friday 25th of November 2016 02:36:57 AM
Old 11-25-2016
The process_line function seems to read from stdin, i.e. the same stream as the read command reads from.
Redirect stdin
Code:
        </dev/null process_line ${current_line}

Or fix the process_line function.
This User Gave Thanks to MadeInGermany For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

passing variables to awk from ksh script

I'm trying to write a ksh script that uses awk, but I want to pass variables to awk. For example (not working): if ];then searchstr=$1 lsof -i | awk '{if($9~/SEARCHSTR/) print $2} SEARCHSTR=$searchstr' else echo "usage: $0 <search string>" fi I tried several options. Is it... (3 Replies)
Discussion started by: rein
3 Replies

2. Shell Programming and Scripting

Passing arrays between functions

Hi, I have a function that hold 3 arrayies. I need to pass them to another function as an input, for further use Could you please explain how to do that. Thanks (5 Replies)
Discussion started by: yoavbe
5 Replies

3. Shell Programming and Scripting

passing a variables value from the called script to calling script using ksh

How do i get the value of the variable from the called script(script2) to the calling script(script1) in ksh ? I've given portion of the script here to explain the problem. Portion of Script 1 ============= ----- ----- tmp=`a.ksh p1 p2 p3` if then # error processing fi -----... (10 Replies)
Discussion started by: rajarkumar
10 Replies

4. Shell Programming and Scripting

passing variables to sed in ksh

Hi, i need help passing variables to sed using ksh. My goal is to get particular data from log files. first i put a mark to the log files. echo "TEST_"`date + %m_%d_%Y_%T"` >markFile this will produce a 'markFile' which contain text like this TEST_06_01_2009_21:55:09 then i put the mark... (2 Replies)
Discussion started by: d.anggrianto
2 Replies

5. Shell Programming and Scripting

Passing array to functions in ksh script

Let me know if there is a way to pass array to a funtion in ksh script. function isPresent { typeset member member=$1 dbList=$2 echo '$1:' $1 echo '$2' $dbList The array will be at the second position....something like this isPresent 12 <array> if then echo... (3 Replies)
Discussion started by: prasperl
3 Replies

6. Shell Programming and Scripting

ksh - for loop with variables

Hi, I 'm trying to send an e-mail for every different line in the .txt for i in {1..$variable} do sed -n "/$i$/p" text.txt done I have two problems about this. First one is that for loop doesn't work and the second one is that i cant get the output of sed (4 Replies)
Discussion started by: ozum
4 Replies

7. Shell Programming and Scripting

Loop to define variables in KSH

Hi, I am trying to use a database to store configurations in an environment definition scripts to make the configurations easily modifiable. (long story short - it is an easier process to make changes in the db than trying to deploy a file). The values will be stored in the database in the... (1 Reply)
Discussion started by: gbala
1 Replies

8. 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

9. Shell Programming and Scripting

ksh passing to awk multiple dyanamic variables awk -v

Using ksh to call a function which has awk script embedded. It parses a long two element list file, filled with text numbers (I want column 2, beginning no sooner than line 45, that's the only known thing) . It's unknown where to start or end the data collection, dynamic variables will be used. ... (1 Reply)
Discussion started by: highnthemnts
1 Replies

10. Shell Programming and Scripting

Passing three variables to loop and error

I have many printer queues to be created in AIX 6.1. I can create printers with this line: /usr/lib/lpd/pio/etc/piomkjetd mkpq_jetdirect -p 'hplj-4000' -D pcl -q 'emg1' -D ps -q 'emg1ps' -h 'emg1' -x '9100' But, I like to feed the printer queue data, called "printfeed", so that I can... (8 Replies)
Discussion started by: Daniel Gate
8 Replies
TS2ES(1)							   User Commands							  TS2ES(1)

NAME
ts2es - extract a single (elementary) stream from a TS (or PS) SYNOPSIS
ts2es [switches] <infile> <outfile> DESCRIPTION
TS tools version 1.11, ts2es built Nov 11 2008 17:15:45 Extract a single (elementary) program stream from a Transport Stream (or Program Stream). Files: <infile> is an H.222 Transport Stream file (but see -stdin and -pes) <outfile> is a single elementary stream file (but see -stdout) Which stream to extract: -pid <pid> Output data for the stream with the given <pid>. Use -pid 0x<pid> to specify a hex value -video Output data for the (first) video stream named in the (first) PMT. This is the default. -audio Output data for the (first) audio stream named in the (first) PMT General switches: -stdin Input from standard input, instead of a file -stdout Output to standard output, instead of a file Forces -quiet. -verbose, -v Output informational/diagnostic messages -quiet, -q Only output error messages -max <n>, -m <n> Maximum number of TS packets to read -pes, -ps Use the PES interface to read ES units from the input file. This allows PS data to be read (there is no point in using this for TS data). Does not support -pid, -stdin or -stdout. TS tools version 1.11, ts2es built Nov 11 2008 17:15:45 Extract a single (elementary) program stream from a Transport Stream (or Program Stream). Files: <infile> is an H.222 Transport Stream file (but see -stdin and -pes) <outfile> is a single elementary stream file (but see -stdout) Which stream to extract: -pid <pid> Output data for the stream with the given <pid>. Use -pid 0x<pid> to specify a hex value -video Output data for the (first) video stream named in the (first) PMT. This is the default. -audio Output data for the (first) audio stream named in the (first) PMT General switches: -stdin Input from standard input, instead of a file -stdout Output to standard output, instead of a file Forces -quiet. -verbose, -v Output informational/diagnostic messages -quiet, -q Only output error messages -max <n>, -m <n> Maximum number of TS packets to read -pes, -ps Use the PES interface to read ES units from the input file. This allows PS data to be read (there is no point in using this for TS data). Does not support -pid, -stdin or -stdout. SEE ALSO
The full documentation for ts2es is maintained as a Texinfo manual. Please check http://tstools.berlios.de for more information. ts2es 1.11 November 2008 TS2ES(1)
All times are GMT -4. The time now is 05:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy