Sponsored Content
Top Forums Shell Programming and Scripting Handling values with space while passing commandline argument from wrapper script in KSH Post 302364703 by cfajohnson on Friday 23rd of October 2009 04:48:11 PM
Old 10-23-2009
Quote:
Originally Posted by kans
Hi there,

I have a wapper script which passes the argument from command prompt to inner script.. It works fine as long as the argument containing single word. But when value contains multiple word with space, not working as expected. I tried my best, couldn't find the reason. Gurus, pls. help me.

Here is the code snippet :

Wrapper.sh

Please wrap code in [code] ... [/code] tags.
Quote:
Code:
#### Wrapper Begin #####
while getopts ":i:" OPTION 2>/dev/null
  do
     case "$OPTION" in
          i) inargI=$OPTARG;;
         \?) print "Usage: $0 -i <ini>"
             exit -1 ;;
      esac
done
echo "$inargI"
$inargI


Code:
eval "$inargI"

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing argument from one script to other

Dear All, I have one script which accepts database name and user_id from the user, i have another script that will unload the data from all the tables based on the user_id accepted by the user. How can i pass the user_id from the 1st script to the other. My OS is sun solaris. Thanks in... (3 Replies)
Discussion started by: lloydnwo
3 Replies

2. Shell Programming and Scripting

New wrapper script will be developed to wrap two ksh scripts

Hi friend,:) The script should invoke these scripts sequentially! When one will finish the second will start. Please help me with it, thanks,:b: Ishai (3 Replies)
Discussion started by: ishai82
3 Replies

3. Shell Programming and Scripting

passing values to function in Ksh

Hi, I'm trying to work on the script given below #!/bin/ksh -x pfile() { echo "$1" } touch smp19 echo "Hi" > smp19 result=$(pfile $smp19) echo $result As highlighted , when i pass $smp19 as parameter ,it does not display the output.However when i try giving "Hi" instead... (2 Replies)
Discussion started by: Sheema
2 Replies

4. Shell Programming and Scripting

Passing commandline argument to a function

Hi, I have 2 ksh scripts. Script1.ksh contains function definition. script1.ksh function f1() { while getopts a:c: args do case $args in a) ARG1=$OPTARG ;; c) ARG2=$OPTARG ;; \?) echo "Error no valid Arguments passed" esac done echo $ARG1 echo $ARG2 script2.sh (2 Replies)
Discussion started by: siba.s.nayak
2 Replies

5. Shell Programming and Scripting

Validating commandline argument

Hi, I am calling a script script2.shl from script1.shl as below script2.shl "TABLE_NAME" -r 10 In that I have to validate the parameter 4. i.e : it should be only 10 20 30 40 50 I know that I can do it by checking like below if ]; then echo "TRUE" else echo "FALSE" fi ... (3 Replies)
Discussion started by: mr_manii
3 Replies

6. Shell Programming and Scripting

Wrapper script Oracle look KSH

I have a KSH script that I want to call in a loop for each row in the above table --- new_script.ksh (psuedo code) the contents on this new script would be something like below... for t in (select table_name,schema_name from laod_table) loop /bin/load_table.ksh t.table_name... (4 Replies)
Discussion started by: vr23
4 Replies

7. Shell Programming and Scripting

passing argument in script?

hi, I want to implement some function to perform following task if ; then $TEXT = "Data_0" else $TEXT = $1 fi if ; then $Lines = 45 else $Lines = $2 fi Kindly suggest, thanks (11 Replies)
Discussion started by: nrjrasaxena
11 Replies

8. Shell Programming and Scripting

Help with Handling multiple argument in shell script

Hi i have written a shell script that takes only single ip address from the user and calculates its latency and reliability, can you please tell me that what should be done if i want that user should enter 100 or 1000 ip address (5 Replies)
Discussion started by: Preeti_17
5 Replies

9. Shell Programming and Scripting

sed commands success / fail from commandline vs ksh script

solaris 5.10 Generic_138888-03 sun4v sparc SUNW,Sun-Fire-T200 I need a sed command that tests true when presented with lines that contain either forward and backslash. input file: c:/myFile.txt c:\yourFile.txt It doesn't appear that sed (in my environment anyway) supports... (4 Replies)
Discussion started by: msutfin
4 Replies

10. Shell Programming and Scripting

Issue handling single quoted argument in shell script.

Below is my script that works fine and prints the desired output: #!/bin/ksh echo "$1" | while IFS= read -r dirpath do echo "DIRR_PATH:$dirpath" install_dir=$install_dir" "$dirpath done echo "Desired Output:$install_dir" Output: ./loopissue.sh... (10 Replies)
Discussion started by: mohtashims
10 Replies
TIDY.GETCONFIG(3)							 1							 TIDY.GETCONFIG(3)

tidy::getConfig - Get current Tidy configuration

       Object oriented style

SYNOPSIS
array tidy::getConfig (void ) DESCRIPTION
Procedural style array tidy_get_config (tidy $object) Gets the list of the configuration options in use by the given tidy $object. PARAMETERS
o $object - The Tidy object. RETURN VALUES
Returns an array of configuration options. For an explanation about each option, visit http://tidy.sourceforge.net/docs/quickref.html. EXAMPLES
Example #1 tidy.getConfig(3) example <?php $html = '<p>test</p>'; $config = array('indent' => TRUE, 'output-xhtml' => TRUE, 'wrap' => 200); $tidy = tidy_parse_string($html, $config); print_r($tidy->getConfig()); ?> The above example will output: Array ( [indent-spaces] => 2 [wrap] => 200 [tab-size] => 8 [char-encoding] => 1 [input-encoding] => 3 [output-encoding] => 1 [newline] => 1 [doctype-mode] => 1 [doctype] => [repeated-attributes] => 1 [alt-text] => [slide-style] => [error-file] => [output-file] => [write-back] => [markup] => 1 [show-warnings] => 1 [quiet] => [indent] => 1 [hide-endtags] => [input-xml] => [output-xml] => 1 [output-xhtml] => 1 [output-html] => [add-xml-decl] => [uppercase-tags] => [uppercase-attributes] => [bare] => [clean] => [logical-emphasis] => [drop-proprietary-attributes] => [drop-font-tags] => [drop-empty-paras] => 1 [fix-bad-comments] => 1 [break-before-br] => [split] => [numeric-entities] => [quote-marks] => [quote-nbsp] => 1 [quote-ampersand] => 1 [wrap-attributes] => [wrap-script-literals] => [wrap-sections] => 1 [wrap-asp] => 1 [wrap-jste] => 1 [wrap-php] => 1 [fix-backslash] => 1 [indent-attributes] => [assume-xml-procins] => [add-xml-space] => [enclose-text] => [enclose-block-text] => [keep-time] => [word-2000] => [tidy-mark] => [gnu-emacs] => [gnu-emacs-file] => [literal-attributes] => [show-body-only] => [fix-uri] => 1 [lower-literals] => 1 [hide-comments] => [indent-cdata] => [force-output] => 1 [show-errors] => 6 [ascii-chars] => 1 [join-classes] => [join-styles] => 1 [escape-cdata] => [language] => [ncr] => 1 [output-bom] => 2 [replace-color] => [css-prefix] => [new-inline-tags] => [new-blocklevel-tags] => [new-empty-tags] => [new-pre-tags] => [accessibility-check] => 0 [vertical-space] => [punctuation-wrap] => [merge-divs] => 1 ) SEE ALSO
tidy_reset_config(3), tidy_save_config(3). PHP Documentation Group TIDY.GETCONFIG(3)
All times are GMT -4. The time now is 03:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy