Running q-shell commands( on IBM-i Series) from cygwin terminal (on windows)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Running q-shell commands( on IBM-i Series) from cygwin terminal (on windows)
# 1  
Old 08-12-2014
Running q-shell commands( on IBM-i Series) from cygwin terminal (on windows)

I have cygwin installed on windows server and when I do

echo $SHELL the output is

/bin/bash


I have created a ssh tunnel from this windows server through cygwin to ibm -i series which is running Q-shell.

I am trying to invoke a utility wsadmin (used for scripting) on ibm-i from the cygwin terminal and I get the error



wsadmin : syntax error at line 12: '(' unexpected

But when I login through the IBM-i client tool and run the same command it works fine.


How can I run the Q-shell commands (on IBM-I) from cygwin terminal(on windows server) without affecting the current scripts using the /bin/bash on cygwin. Is there a setting I am missing ?
# 2  
Old 08-12-2014
Please show exactly what you have done, word for word, letter for letter, keystroke for keystroke (blanking confidential things, of course.) It's very hard to tell what's not working without seeing this.
# 3  
Old 08-12-2014
I am trying to invoke a scripting utility called wsadmin on ibm-iseries.

Steps below to invoke the scripting client on I-series through IBM-I command line utility

1. login through the ibm-command line client

2. Start the QSHELL using the command STRQSH

3. Navigate to the folder where my scripting utility (wsadmin) is present and ran

4. wsadmin -lang jython

5. The output is as below

The java.version property was detected as input. This property is used as out
put only and has no effect on JVM initialization.
WASX7209I: Connected to process "dmgr" on node BoxManager using SOAP connec
tor; The type of process is: DeploymentManager
WASX7031I: For help, enter: "print Help.help()"
wsadmin>

6. I get the wsadmin prompt successfully which is what I am looking for.


=============================================================================

I wanted to invoke the same utility on the IBM-I series from a windows machine


Now I installed cygwin on a windows machine and set up a ssh tunnel to IBM-I series machine mentioned above ...so I could run the wsadmin utility on IBM-I series from cygwin.


====================================================================================

Verified the ssh tunnel by logging in using the command

ssh user@ibm-i and I was able to login to the IBM-I series machine

======================================================================================
I navigated to the path where wsadmin is present and ran the same command

wsadmin -lang jython and I got the error


wsadmin : syntax error at line 12: '(' unexpected


============================================================================================

My question : Is there some settings that needs to be done to run Q-SHELL COMMANDS on cygwin ?
# 4  
Old 08-12-2014
Thank you, that's very helpful, rules out a lot of problems I'd been wondering about.

Are you logging in with a different user than you usually would? I wonder if it ended up with a different default shell somehow.
# 5  
Old 08-12-2014
Please let me know if my explanation isn't clear.

---------- Post updated at 01:32 PM ---------- Previous update was at 01:28 PM ----------

This is the first time I started the wsadmin utility from cygwin terminal. I verified the user I am logging in with on cygwin terminal has full execute permissions. The shell on IBM-I is QShell but the default on cygwin shows /bin/bash.
# 6  
Old 08-12-2014
Cygwin's user and shell shouldn't matter, once you log into the IBM server.

Cygwin's unusual terminal might cause issues, but I wouldn't expect it to cause that issue -- not recognizing the same script on the same local machine. Obviously the file itself hasn't changed. Maybe the interpreter, the environment, or your user credentials have.

I'm wondering what the difference is between how you log into the IBM server here, and how you would log in otherwise. I don't mean the ssh tunnel -- I mean things like username and credentials on the IBM machine. Things which would affect your profile, envirionment, etc on login.

I don't suppose it'd be as easy as running . /etc/profile first...
# 7  
Old 08-12-2014
Just a clarification so we are on the same page

ImageImage
Attached figure showing the windows 2003 machine and the IBM-i machine.

I use the ibm-client to login to IBM-i and it works

then I use the cygwin terminal to run the same command I get an error
Running q-shell commands( on IBM-i Series) from cygwin terminal (on windows)-cygwin-path-ibm-ijpg
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

IBM ServeRAID M5100 Series

Hi, Is it possible to check progress when replace a faulty disk without reboot server? OS is RHEL 5. Please advice. Thanks. (1 Reply)
Discussion started by: mzainal
1 Replies

2. AIX

How to Login Bios Server IBM p series?

Hii guys, I have IBM server power series, how to login BIOS at server IBM Power7 750, 730, 720, 520 and 550 ? and if I will new Install AIX, How I config " First Boot DVD" ?? I use command " # mount -V cdrfs -o ro /dev/cd0 /mnt " ( not work after reboot system). I need your help... (2 Replies)
Discussion started by: williamen
2 Replies

3. Shell Programming and Scripting

How to save and execute terminal commands in shell?

I frequently use some commands, which I want to save in some file say myregularshell.shthese are the commands I use, I tried saving and executing, but couldn't get the preview of execution, and result is also not coming if I copy same commands and paste it on terminal result is coming cd go... (2 Replies)
Discussion started by: Akshay Hegde
2 Replies

4. Shell Programming and Scripting

Running shell script in Cygwin terminal

I am new to shell scripting. I tried to run a simple shell script using Cygwin terminal in Win XP env. The script I have written is as follows - #!/bin/bash a=5 ] && echo "true" || echo "false" But when I execute the script, getting some confusing error. The error I am getting are - ... (3 Replies)
Discussion started by: linux_learner
3 Replies

5. OS X (Apple)

[Solved] Running shell code in AppleScript without Terminal

What I want my script to do is to run a command in Terminal and close that same Terminal window when the process is complete. Of course I could ad a delay of 6 seconds to complete the process, but it may not be enough every time. To simplify my question, this is what I want to achieve.... (9 Replies)
Discussion started by: ShadowofLight
9 Replies

6. AIX

IBM AIX on IBM Eseries & x series server

Hi, I want to know whether IBM AIX can be installed on the IBM e series and x series server hardware? Thanks & Regards Arun (2 Replies)
Discussion started by: Arun.Kakarla
2 Replies

7. AIX

installation of 5.2 on iBM p series system

Hi all, we have iBM p series server on that 4. 3 operating system is runing.but i need ti install 5.2 or 5.3 then i ahve to install oracle 10g release 2 .but we have only 1 GB of RAM.can i install 5.2 or 5.3 with same RAM and please send me a document which discribe about how to install... (5 Replies)
Discussion started by: younusdba
5 Replies

8. UNIX for Dummies Questions & Answers

Running Terminal and/or X-Windows in Mac OS X

Quick question: When I load up Terminal or X-Windows on my Mac, and the prompt comes up...what folder am I starting in? (2 Replies)
Discussion started by: liquidcross
2 Replies

9. Programming

Ibm Mq Series

hi everybody, My name is Raj i work in GE Global Software Solutions As Siebel Analyst. Can any one help in writing the code in Ansi C on HP-Unix platform to get data from IBM MQ-Series Server. IBM MQ-series client will be installed on the client machine which is on WIN NT platform. And MQ-series... (2 Replies)
Discussion started by: garimella
2 Replies
Login or Register to Ask a Question