Getopt eval set parameters not happening when the script is called through an application!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Getopt eval set parameters not happening when the script is called through an application!
# 1  
Old 11-04-2016
Getopt eval set parameters not happening when the script is called through an application!

Hi,

There is an Informatica tool through which unix scripts can be called. Now the requirement in my project is that a parent script calls a child script but this parent script has to be called through the Informatica tool.

In Parent script I'm using

Code:
TEMP=`getopt -o x:y: -l area:,volume: -- "$@"`
 eval set -- "$TEMP"

It works fine on Linux box but when I run the parent script through the tool it says

Code:
 
 Remote script with arguments is --

It's not able to execute
Code:
eval set -- $TEMP

Any suggestions on how to resolve this?



Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 11-04-2016 at 08:05 AM.. Reason: Changed HTML to CODE tags.
# 2  
Old 11-04-2016
The getopt utility is still available on many systems, but it has been obsolete for decades and suffers from several shortcomings. Try using getopts instead.

And, of course, without knowing what options you're trying to parse and what the rest of your script looks like it is impossible to provide much real help. My crystal ball is too cloudy today. Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Remote login UNIX box from java passing parameters to the custom script called in the profile

Hello Good Day / Guten Tag.... I have to login the server and the user profile contains some scripts which need the inputs to be taken from the keyboard. So I use the method to conn.authenticateWithKeyboardInteractive(username, new InteractiveCallback() { public String... (1 Reply)
Discussion started by: Sanalkumaran
1 Replies

2. UNIX for Beginners Questions & Answers

Eval set -- and more

Hello everyone, I am taking a course on Lynda and they show this code below. I didn't fully understand some parts. Please see the questions within the code. Thank you for your input and time. Regards, function usage { echo Options are -r -h -b -x --branch --version --help --exclude... (9 Replies)
Discussion started by: mohca2020
9 Replies

3. Shell Programming and Scripting

How do i check if all parameters are set in bash?

Hi, I have 4 parameters passed to my shell and i validate if all four are entered using the following snippet: if then echo "Not entered" else echo "entered" fi I get the following output as 'Not entered even when i enter the values for all prompts. Please advise. Thanks. (5 Replies)
Discussion started by: Jesshelle David
5 Replies

4. Shell Programming and Scripting

Grep final set of parameters from fit.log gnuplot file

I would like to grep the final set of fit parameters from a gnuplot log file to form columns that look like this. a_1001 b_1001 x_1001 a_1002 b_1002 x_1002 a_1003 b_1003 x_1003 . . . . . . . . . a_1250 b_1250 c_1250 At... (8 Replies)
Discussion started by: kayak
8 Replies

5. Shell Programming and Scripting

Error in eval eval command to print html tags

anyone has any info on why this is complaining??? vivek@vivek-c5e55ef2e ~/TAC $ zoneCounter=1 vivek@vivek-c5e55ef2e ~/TAC $ optUsage1=23% vivek@vivek-c5e55ef2e ~/TAC $ eval eval echo "<th>Zone $zoneCounter </th><th align=\"left\"> \$optUsage$zoneCounter </th>" -bash: syntax error... (13 Replies)
Discussion started by: vivek d r
13 Replies

6. Shell Programming and Scripting

Error in eval eval command to print html tags

anyone has any info on why this is complaining??? vivek@vivek-c5e55ef2e ~/TAC $ zoneCounter=1 vivek@vivek-c5e55ef2e ~/TAC $ optUsage1=23% vivek@vivek-c5e55ef2e ~/TAC $ eval eval echo "<th>Zone $zoneCounter </th><th align=\"left\"> \$optUsage$zoneCounter </th>" -bash: syntax error... (1 Reply)
Discussion started by: vivek d r
1 Replies

7. Shell Programming and Scripting

Strange result of eval, how does eval really work with ssh?

Hi all, some small script with eval turned me to crazy. my OS is linux Linux s10-1310 2.6.16.53-0.8.PTF.434477.3.TDC.0-smp #1 SMP Fri Aug 31 06:07:27 PDT 2007 x86_64 x86_64 x86_64 GNU/Linux below script works well #!/bin/bash eval ssh remotehost date eval ssh remotehost ls below... (1 Reply)
Discussion started by: summer_cherry
1 Replies

8. Shell Programming and Scripting

KSH script eval(?) to set variable

first of all, thanks to all on this board, it has been a huge resource to answer most of my questions! I am stuck on something that should really be simple, and was looking for some help.. I am using KSH on solaris and working on a script to move containers from server to server. Where i am... (4 Replies)
Discussion started by: tksol
4 Replies

9. Shell Programming and Scripting

using eval with set, wc, and expr

Okay this is a mess, I'm trying to assign variables with variables in a for-loop. Here is what i have for code. The syntax is not good. Given the following script: #! /bin/csh foreach site (ABC DEF GHI) eval set \t$${site}sf = ``wc -l \$${site}.sf | awk '{print $1}'`` eval set... (2 Replies)
Discussion started by: wxornot
2 Replies

10. AIX

Ping is happening, telnet is not happening

HI all, Ping is happening to a AIX box...but telnet is not happening... AIX box doesn't have any conslole... Please help how to resolve it. Thanks in advance .. Manu (2 Replies)
Discussion started by: b_manu78
2 Replies
Login or Register to Ask a Question