Passing space separated value to a function - error
Taking inputs in the script which is space separated and passing this to a function and i have assigned like below
And then when I use for loop for the inputs i got from the user, it is taking only the first argument.
this is printing always the first name .. here as Bala
Pl help me how to get all values in the function.
Last edited by vgersh99; 09-30-2009 at 10:14 AM..
Reason: code tags, PLEASE!
I need to pass a parameter to a function in a script. My parameter is a string. When I display the parameter within my function, I only get the first word from string I pass in.
How can I make the function receive the whole string (and not terminate at the first space it encounters)?.
part of... (2 Replies)
Hi ,
I have three funcions f1, f2 and f3 .
f1 calls f2 and f2 calls f3 .
I have a global variable "period" which i want to pass to f3 .
Can i pass the variable directly in the definition of f3 ?
Pls help .
sars (4 Replies)
Hi,
I've been trying to use grep to find out all the files which have two particular patterns in it (both pattern1 AND pattern2). I have a script to do the same, in which I'm getting the output of the first grep (with -l option) which contains the list of file paths and I'm trying to search for... (3 Replies)
How do I loop thru space separated values in a variable?
I hate to use very complicated counter increment logic for this kind of simple problem.
Expected result(using ksh)
$>echo "aaa bbbb cccc" | <looping code here>
var=aaa
var=bbbb
var=cccc
$>echo "aaa bbbb cccc" | while IFS=" "... (12 Replies)
hi All,
i am trying to pass arguments that contain space , value will be stored in variables to be used further in script , i went thru previous posting , still its not clear to how to implement for my case.
passing 3 args
test.sh it is 'fun to work in unix'
inside shell
... (3 Replies)
Hi,
I have a large number of files which are written as csv (comma-separated values).
Does anyone know of simple sed/awk command do achieve this?
Thanks!
---------- Post updated at 10:59 AM ---------- Previous update was at 10:54 AM ----------
Guess I asked this too soon. Found the... (0 Replies)
Hi
I have been racking my (limited) brains to get this to work without success
I have a file output which is a list of lists - ie a single column of data that is separated by space into sub lists below - I need to both split this so that each list is in a separate column (eg tab or semicolon... (8 Replies)
After some thought.
I am uncomfortable issuing my professors name where, there may be unintended side effects from any negative responses/feedback. Willing to re post if I can omit school / professor publicly, but can message moderator for validation? I am here for knowledge and understanding,... (1 Reply)
Hi,
I am having a file say list1 with a output like below
jun 12 18:23
may 20 18:23
Now i want to pass the above two values into for loop,I have written a script like this.
#!/bin/bash
a=`cat list1`
for i in $a
do
echo "HI $i"
done
expected output:
HI jun 12 18:23 (3 Replies)
Hello All,
I would like to ask help from you on how to pass variable value from a function that has been called inside the function. I have created below and
put the variables in " ". Is there another way I can do this? Thank you in advance.
readtasklist() {
while read -r mod ver... (1 Reply)
Discussion started by: aderamos12
1 Replies
LEARN ABOUT DEBIAN
pbc_merge
MAIN.C(1) Debian GNU/Linux manual MAIN.C(1)NAME
pbc_merge - Merge multiple Parrot bytecode (PBC) files into
a single PBC file.
SYNOPSIS
pbc_merge -o out.pbc input1.pbc input2.pbc ...
DESCRIPTION
This program takes two or more PBC files and produces a single merged output PBC file with a single fix-up table and constants table.
Command-Line Options
"-o out.pbc"
The name of the PBC file to produce, containing the merged segments from the input PBC files.
Functions
"static void help(void)"
Print out the user help info.
"static PackFile_ByteCode* pbc_merge_bytecode(PARROT_INTERP, pbc_merge_input **inputs, int num_inputs, PackFile *pf)"
This function merges the bytecode from the input packfiles, storing the offsets that each bit of bytecode now exists at.
"static PackFile_ConstTable* pbc_merge_constants(PARROT_INTERP, pbc_merge_input **inputs, int num_inputs, PackFile *pf)"
This function merges the constants tables from the input PBC files.
"static void pbc_merge_debugs(PARROT_INTERP, pbc_merge_input **inputs, int num_inputs, PackFile_ByteCode *bc)"
This function merges the debug segments from the input PBC files.
"static void pbc_fixup_bytecode(PARROT_INTERP, pbc_merge_input **inputs, int num_inputs, PackFile_ByteCode *bc)"
Fixup bytecode. This includes correcting pointers into the constant table and updating the ops mapping.
"static void pbc_fixup_constants(PARROT_INTERP, pbc_merge_input **inputs, int num_inputs)"
Fixup constants. This includes correcting pointers into bytecode.
"static PackFile* pbc_merge_begin(PARROT_INTERP, pbc_merge_input **inputs, int num_inputs)"
This is the function that drives PBC merging process.
"static void pbc_merge_write(PARROT_INTERP, PackFile *pf, const char *filename)"
This functions writes out the merged packfile.
"int main(int argc, const char **argv)"
The main function that grabs console input, reads in the packfiles provided they exist, hands them to another function that runs the
merge process and finally writes out the produced packfile.
Debian Project 2012-01-08 MAIN.C(1)