Absent Member.. hezewu Absent Member..
Absent Member..
670 views

I need help with the shell operation

Hi, I am an hpoo newbie. Please I need help with using the shell opearation. I am using v9.06.

I am trying to call a script that will create some csv files ( create_csv_files) which then encrypts the files with gpg.

All I need is to run a command (create_csv_file) then supply a key (fakeemail.com).

 

So from command line the actual command will look like this

# create_csv_files -r fakeemail.com

 

 

In Shell operations I tried: SSH Shell

expect (.*\s*)*?
send create_csv_file
expect (.*\s*)*?
send -r fakeemailaddress
expectEndsWith m

 

But no luck, please any help will be appreciated

 

See error below:

 

{Result=Script did not fully finish, had: 1 commands left java.lang.Exception: readTimedout at: 20001ms
Instructions left: 1;returnResult=Script did not fully finish, had: 1 commands left java.lang.Exception: readTimedout at: 20001ms
Instructions left: 1;returnCode=-1;sessionId=iconclude1617176432324080310;exception=Script did not fully finish, had: 1 commands left java.lang.Exception: readTimedout at: 20001ms
Instructions left: 1;STDOUT=Last login: Mon Jul 13 15:50:16 2015 from 10.178.5.84
[root@shiroo]~>create_csv_files
Must specify a receiver GPG public key with -r
[roo@shiroo]~>-r fakeemail.com
-bash: -r: command not found
[root@shiroo]~>;visualized=<Frames>
<Frame index="1">Last login: Mon Jul 13 15:50:16 2015 from 10.178.5.84
[roo@shiroo]~&gt;create_csv_file
Must specify a receiver GPG public key with -r
[root@shiroo]~&gt;-r fakeemail.com
-bash: -r: command not found
[root@shiroo]~&gt;</Frame>
</Frames>;}

 

 

 

Labels (1)
0 Likes
1 Reply
Malchore Absent Member.
Absent Member.

Re: I need help with the shell operation

The solution is simple: Don't use the SSH Shell operation. Instead use SSH Command operation.

 

SSH Shell is usefull if you want to send multiple commands during the same SSH session....

 

send <command>

expect <response>

send <command>

expect <response>

 

etc etc.

 

SSH Command is much simpler and will wait until it gets all the output of the command before it exits. Just be sure to be aware of your timeout input. If the 'create_csv_files' script takes 2 minutes to complete, make sure you set the timeout appropriately.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.