Sponsored Content
Top Forums Shell Programming and Scripting How to pass and read an array in ksh shell script function.? Post 303039851 by mohtashims on Wednesday 16th of October 2019 10:45:39 AM
Old 10-16-2019
Quote:
Originally Posted by RudiC
The first posistional parameter is NOT an array, and thus can't be indexed.


How about
Code:
verifyfiles() {  for sym ; do echo "Array in FUNCTION Contains:";     echo "$sym"; done; }
.
.
.
verifyfiles ${filelist[@]}
Array in FUNCTION Contains:
val1
Array in FUNCTION Contains:
val2
Array in FUNCTION Contains:
val3

@Rudic thank you for the inputs. How can we assign the passed array to a variable in the function. I ask this becoz i did not get a chance to go back to my system and try out how to do that.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to pass arguments to a function in a shell script?

Hi, I have two shell variables $t1 and $t2 which I need to pass to a function in a shell script. The function will do some computation with those two variables and echo the resultant. But I do not know how to pass teh arguments. The function written is f1() {...... ........ } What should... (3 Replies)
Discussion started by: preetikate
3 Replies

2. Shell Programming and Scripting

How to read values that are passed to the shell function in ksh.

In ksh shell, There is a function f1. function f1 { How to read here?? .... .... } I am passing values to fuunction f1 as f1 "A" "B" Please tell me how to read the passed values in function f1. Advance Thanks & Regards Prashant (2 Replies)
Discussion started by: prashant43
2 Replies

3. Shell Programming and Scripting

How to pass an array from SHELL to C function

Hi, I have an output generated from a shell script like; 0x41,0xF2,0x59,0xDD,0x86,0xD3,0xEF,0x61,0xF2 How can I pass this value to the C function, as below; int main(int argc, char *argv) { unsigned char hellopdu={above value}; } Regards Elthox (1 Reply)
Discussion started by: elthox
1 Replies

4. Programming

How to pass C array as input to Shell script

Hi, In the below C code , i want to pass the array to a unix shel script. my script should called as ex myscript 1,2,3 #include <stdio.h> int main() { int a={1,2,3}; } Thanks, Arun (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

5. Shell Programming and Scripting

What is the maximum number of parameter we can pass to a shell script function?

what is the maximum number of parameter we can pass to a shell script function (8 Replies)
Discussion started by: alokjyotibal
8 Replies

6. Shell Programming and Scripting

How to pass parameter to User defined function in shell script?

Hello, Can anyone guide me tin passing parameters into user defined function of shell script (KSH). Here is my code, InsertRecord() { DB_TBL=$(sqlplus $USERID/$PASSWORD@$DATABASE << EOF set head off set feed off set serveroutput on INSERT INTO TBL1 ( OLD_VAL, NEW_VAL, ... (7 Replies)
Discussion started by: Poonamol
7 Replies

7. Shell Programming and Scripting

How to pass an array to a function in shell script.?

hi, I have a array say SAP_ARRAY="s1.txt" SAP_ARRAY="s2.txt" how can i pass this full array to a function. here is the sample code i am using.. CHECK_NO_FILES() { FARRAY=$1 echo "FARRAY = $FARRAY" echo "FARRAY = $FARRAY" ............... (5 Replies)
Discussion started by: Little
5 Replies

8. Shell Programming and Scripting

Pass array to a function and display the array

Hi All I have multiple arrays like below. set -A val1 1 2 4 5 set -A val2 a b c d . . . Now i would like to pass the individual arrays one by one to a function and display/ do some action. Note : I am using ksh Can you please advise any solution... Thanks in advance. (7 Replies)
Discussion started by: Girish19
7 Replies

9. Shell Programming and Scripting

Pass C shell array to another C shell script(csh) and shell(sh)

Dear Friends, Please help me on this my script name is send.csh In this i have written the statement like this set args = ( city state country price ) I want to pass this array to another c shell called receiver.csh. and i want to use it in this c shell or how to pass to... (2 Replies)
Discussion started by: SA_Palani
2 Replies

10. Shell Programming and Scripting

Shell script to pass the config file lines as variable on the respective called function on a script

I want to make a config file which contain all the paths. i want to read the config file line by line and pass as an argument on my below function. Replace all the path with reading config path line by line and pass in respective functions. how can i achieve that? Kindly guide. ... (6 Replies)
Discussion started by: sadique.manzar
6 Replies
CISS(4) 						   BSD Kernel Interfaces Manual 						   CISS(4)

NAME
ciss -- HP/Compaq Smart ARRAY 5/6 RAID controllers SYNOPSIS
ciss* at pci? function ? DESCRIPTION
The ciss driver provides support for the CISS interface implemented by fifth and later generations of the HP/Compaq Smart ARRAY family of controllers. The CISS interface is defined in the document entitled CISS Command Interface for SCSI-3 Support Open Specification, Version 1.04, Valence Number 1, Compaq Computer Corporation, 2000/11/27. This driver supports several Compaq and HP controllers implementing the CISS interface, including: o Compaq Smart Array 5300 version 1 o Compaq Smart Array 5300 version 2 o Compaq Smart Array 5i version 1 o Compaq Smart Array 5i version 2 o HP Smart Array 5312 o HP Smart Array 6i o HP Smart Array 641 o HP Smart Array 642 o HP Smart Array 6400 o HP Smart Array 6400 EM o HP Smart Array E200 o HP Smart Array E200i o HP Smart Array P400 o HP Smart Array P400i o HP Smart Array P600 o HP Smart Array P800 o HP Smart Array V100 o HP Smart Array 1 through 13 These controllers support RAID 0, RAID 1, RAID 5, JBOD, and superpositions of those configurations. Although the controllers are actual RAID controllers, the ciss driver makes them look just like SCSI controllers. All RAID configuration must be done through the controllers' BIOSes. Hardware from previous generations of this product family may be supported by the cac(4) driver. SEE ALSO
bio(4), cac(4), intro(4), pci(4), scsi(4), sd(4) HISTORY
The ciss driver first appeared in NetBSD 3.1. AUTHORS
The ciss driver was written by Michael Shalayeff <mickey@openbsd.org>, and ported to NetBSD by Tonnerre Lombard <tonnerre@netbsd.org>. BSD
May 28, 2008 BSD
All times are GMT -4. The time now is 01:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy