Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Lost files ......

Posted on 2000-05-08
12
Medium Priority
?
350 Views
Last Modified: 2012-08-14
I have ftp'd an ASCII based Expect script onto an AIX box.  I have altered the file attributes to executable and then attempted to run the script.  I get the message ..... " ksh: goto:  not found. ".
I am in the correct directory which is itself included in the PATH variable.  Expect has been installed and seems to function correctly.  I have deleted the file and re-copied several times without success.  The system does not appear to acknowledge that the file exists.

Does anyone have any ideas as to the cause plus the solution of this little difficulty????????
0
Comment
Question by:rigsby
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +5
12 Comments
 
LVL 1

Expert Comment

by:alexhudghton
ID: 2788820
is the route to Expect included in your PATH variable ? (i.e /usr/local/bin/expect or whherever it is)
0
 
LVL 1

Expert Comment

by:alexhudghton
ID: 2788821
is the route to Expect included in your PATH variable ? (i.e /usr/local/bin/expect or wherever it is)
0
 
LVL 14

Accepted Solution

by:
chris_calabrese earned 600 total points
ID: 2788858
alexhudghton's comment implies that you are calling this thing like
  expect /my/script

But your description sounds more like you are just calling
  /my/script
after making it executable.

If this is so, it sounds like you're missing the #! directive at the top of the script to tell the system that this is not a shell script but rather an expect script.  That would usually look something like

  #!/usr/local/bin/expect

Another possibility I thought of is that you're actually calling
  ksh /my/script

which isn't going to work because ksh will always assume this is a shell script.

Finally, it occurs to me that you may also be trying to call the script out of cron, in which case you might need to explicitly call expect like
  expect /my/script
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:rigsby
ID: 2789229
Thanks for the help guys!!!!

I am actually calling the script name just as it is (name only).  The script is a fully working script much used previously but is just being copied to another box,  It already has the " #!/usr/bin/expect -- " first line.

It just appears that the shell (ksh) does not seem to think it exists i.e in the director within the filesystem etc.

The OS is AIX 4.2.1.0
and Expect is expect-5.31.5.0.bff - a freeware archive.

Hope you can help.
0
 
LVL 21

Expert Comment

by:tfewster
ID: 2789411
Is "goto" the name of the script? What happens if (in that directory) you do "touch test.sh; chmod 755 test.sh; test.sh"?
0
 
LVL 14

Expert Comment

by:chris_calabrese
ID: 2789477
Is expect actually in /usr/bin, or is it somewhere else?
0
 
LVL 1

Expert Comment

by:meerak
ID: 2789965
Either you do not have " expect"  at /usr/bin or /usr/bin/expect does
not have execute permission.

Basically the script you are executing is assumed to be a ksh
script instead of an "expect" script. There is no "goto" in ksh.

If you have #!/usr/bin/expect as you first line it means that
"expect" is the name of the shell to be used for executing the
script.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2795928
What happens if you invoke expect with the script as its input (expect myscript)? Has the script passed through a windows box at some point in the FTP transfers between machines? If it did there could be carriage returns at the end of each line that will need to be removed before the script is usable on Unix.
0
 
LVL 1

Expert Comment

by:bhagawatula
ID: 2802713
Try this:
1) can you cat the file?
2) if yes, do " cat file > newfile"
This may sound stupid, but I faced similar poblem on solaris, when I transfered a file over ftp from a linux box. This also happend when I used Copy and Past in vi.
try to execute the newfile...


Best of luck
Hemanth
0
 
LVL 12

Expert Comment

by:geotiger
ID: 2815707
Can you post the expect script? Did you find "goto" in the script? I think some where the code in the script was broken. Some where the script try to run ksh. Look the following test I did:  


$ more ./tt
#!/bin/ksh
goto

$ ./tt
../tt[2]: goto:  not found
$ ksh goto
ksh: goto:  not found

The tt ksh script only contains "goto". When I run it, it display the script name. When you run "ksh goto", you get the error of "ksh: goto:  not found."

Hope this helps.
0
 

Author Comment

by:rigsby
ID: 2868398
Comment accepted as answer
0
 

Author Comment

by:rigsby
ID: 2868399
Many thanks Chris ...... sorry took so long!!!!!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question