Array as argument


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Array as argument
# 8  
Old 09-28-2009
Quote:
Originally Posted by chipcmc
Code:
./sh2.sh ${k[*]}


That should be:

Code:
./sh2.sh "${k[@]}"

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash 3.2 - Array / Regex - IF 3rd member in array ends in 5 digits then do somthing...

Trying to do some control flow parsing based on the index postion of an array member. Here is the pseudo code I am trying to write in (preferably in pure bash) where possible. I am thinking regex with do the trick, but need a little help. pesudo code if == ENDSINFIVEINTS ]]; then do... (4 Replies)
Discussion started by: briandanielz
4 Replies

2. Shell Programming and Scripting

Creating an array with options as an argument!

Hi Guys, I am writting a c shell script where I have to parse an input argument with options that could be an array. So far I have achieved where I could parse a single argument with option but failed when I try to create an array with the options. For example: This is on terminal window:... (2 Replies)
Discussion started by: dixits
2 Replies

3. UNIX for Advanced & Expert Users

Error:--test: argument expected--Even though i give an argument.

Hi All, I am running the script VBoxManage list vms |sed 's/"//g' | cut -d " " -f1 > har1out.mytxt result=`cat har1out.mytxt | grep $1' echo $result echo $1 { if then echo pass else echo fail fi (2 Replies)
Discussion started by: harsha85
2 Replies

4. Shell Programming and Scripting

PERL : Read an array and write to another array with intial string pattern checks

I have an array and two variables as below, I need to check if $datevar is present in $filename. If so, i need to replace $filename with the values in the array. I need the output inside an ARRAY How can this be done. Any help will be appreciated. Thanks in advance. (2 Replies)
Discussion started by: irudayaraj
2 Replies

5. Shell Programming and Scripting

Make script that run with argument if not run from configuration file argument

Hello, Is there any method thorugh which script can take argument if pass otherwise if argument doesn't pass then it takes the argument from the configuration file i.e I am workiing on a script which will run through crontab and the script will chekout the code ,zip and copy to the... (3 Replies)
Discussion started by: rohit22hamirpur
3 Replies

6. Shell Programming and Scripting

Cannot compare argument in if statement in csh/grep command if argument starts with “-“

If ($argv == “-debug”) then Echo “in loop” Endif But this is not working. If I modify this code and remove “-“, then it works. Similarly I am getting problem using grep command also Grep “-debug” Filename Can someone please help me on how to resolve these... (1 Reply)
Discussion started by: sarbjit
1 Replies

7. Shell Programming and Scripting

get positive number n as argument script must calculate the factorial of its argument

Can someone please help me with this SHELL script? I need to create a script that gets a positive number n as an argument. The script must calculate the factorial of its argument. In other words, it must calculate n!=1x2x3x...xn. Note that 0!=1. Here is a start but I have no clue how to... (3 Replies)
Discussion started by: I-1
3 Replies

8. Programming

Creating an array to hold posix thread ids: Only dynamic array works

I am facing a strange error while creating posix threads: Given below are two snippets of code, the first one works whereas the second one gives a garbage value in the output. Snippet 1 This works: -------------- int *threadids; threadids = (int *) malloc (num_threads * sizeof(int)); ... (4 Replies)
Discussion started by: kmehta
4 Replies

9. UNIX for Dummies Questions & Answers

How to find the last argument in a argument line?

How to find the last argument in a argument line? (4 Replies)
Discussion started by: nehagupta2008
4 Replies

10. UNIX for Dummies Questions & Answers

array as command line argument !!!!

hello, can any help me how to can pass array as command line argument in korn shell. also how to read a array from command line. thanks spandu (2 Replies)
Discussion started by: spandu
2 Replies
Login or Register to Ask a Question
PCT-SCANNER-SCRIPT(1)					      General Commands Manual					     PCT-SCANNER-SCRIPT(1)

NAME
pct-scanner-script - easy scan and create merged DjVu and PDF documents for archiving SYNOPSIS
pct-scanner-script [--help] DESCRIPTION
pct-scanner-script is a bash script and configuration system to easily scan documents and create a digital archiving. It can create DjVu PDF and JPEG outputs, in merged and individual files. It also has a configuration system where different configurations can be defined, making it easy to switch between configurations. Please use pct-scanner-script --help to find all program options, the complete help, and all examples. Features: - auto archiving in merged and individual DjVu, PDF, and JPEG files - auto and manual resume when scanning somehow fails - cascading configuration system, for easy customizing - easy command-line-style bash program, with useful options - archiving made possible with both adf and flatbed scanners - built for productivity and daily use - uses bash, scanadf and other mainstream processing tools - multilanguage commandline output OPTIONS
-h, --help, -? Show summary of options, help, and examples. DEBUGGING
This program is a helper script to easy scan and automated digital document archiving for normal and adf scanners. You can debug this script by running it as bash -x pct-scanner-script [options]. The script is just a nice wrapper for the scanadf, DjVu and PDF tools. SEE ALSO
scanadf(1), AUTHOR
pct-scanner-script and this manual page are written by: Jelle de Jong <jelledejong@powercraft.nl>. March 31, 2009 PCT-SCANNER-SCRIPT(1)