Executing expect script giving message as bad interpreter: Permission denied


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Executing expect script giving message as bad interpreter: Permission denied
# 1  
Old 03-09-2010
Executing expect script giving message as bad interpreter: Permission denied

Hi Gurus,

I am new to scripting and needs your help in expect script used for telnet. I wrote a simple script as

Code:
#!/usr/bin/expect-5.43 -f
spawn telnet localhost 2233
expect "password:"
send "secret\r" 
send "i data.cnbc.com\r"
send "exit\r"
expect eof

When I am trying to execute it, it gives message as:
Code:
./expect_script.exp 
-bash: ./expect_script.exp: /usr/bin/expect-5.43: bad interpreter: Permission denied

Could you pls help me what's wrong with it?
Thanks in Advance

Regards,
niks.

Last edited by Scott; 03-09-2010 at 03:29 PM.. Reason: Please use code tags
# 2  
Old 03-09-2010
Quote:
Originally Posted by niks_yv
...When I am trying to execute it, it gives message as:
Code:
./expect_script.exp 
-bash: ./expect_script.exp: /usr/bin/expect-5.43: bad interpreter: Permission denied

Could you pls help me what's wrong with it?
...
What's the output of the following two commands ?

Code:
ls -l /usr/bin/expect-5.43
ls -l ./expect_script.exp

tyler_durden
# 3  
Old 03-09-2010
Further to durden_tyler.
And:

Code:
ls -la /usr/bin/expect*

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Executing bash file with sudo for the second time, leads to permission denied, for some commands

I have a script that checks if the script has been ran with sudo. If the script is not ran as sudo, the current script is being executed with exec sudo bash. You are asked for a password, you type in the password, success. Everything is perfect - the commands inside the script are ran as sudo.... (1 Reply)
Discussion started by: boqsc
1 Replies

2. Programming

msgget message queue always get permission denied

I want to use msgget() to obtain a message queue between two processes, here is my code: the first one create the mq, the second one open it and add a message to it. But when I execute the second one, I get permission denied. I've already desperately tried everything I can think of to solve this... (2 Replies)
Discussion started by: tefino
2 Replies

3. Shell Programming and Scripting

bad interpreter when running script

Hi All, I'm not confortable in writing script, can someone can help me, when I run that script below i found this error code : -bash: ./script.sh: /bin/sh.: bad interpreter: Here is the script for i in * x=${i##*.} z=$(perl -e 'print time;') t=$(echo $z-$x|bc)... (12 Replies)
Discussion started by: bzb23
12 Replies

4. Programming

Permission denied when creating message queue

Hi guys. i have wrote a simple program to test message queue attributes. here it is: #include <stdio.h> #include <stdlib.h> #include <mqueue.h> #include <fcntl.h> #include <string.h> #include <errno.h> #include <sys/stat.h> int main() { struct mq_attr attr; mqd_t mqd; ... (2 Replies)
Discussion started by: majid.merkava
2 Replies

5. Shell Programming and Scripting

bad interpreter: Permission denied

Hi I am running a script: #!bin/bash set -x echo"select * from celldatamap;" || sqlcsv -v -h -s ',' -d MTNSA11G -u datasafe -p datasafe > andrea.csv When I run my script ./tablescript.sh I get the following error: $ ./tablescript.sh (3 Replies)
Discussion started by: ladyAnne
3 Replies

6. Shell Programming and Scripting

Permission denied while executing rsh

Hi All, I have two servers, say server1 and server2. I have put the entries of both servers in /.rhosts file of both servers. So, when I tried to run following from server1- rsh server2 "ls" Permission denied was printed on console. Can anyone help me out? Regards, akash mahakode (4 Replies)
Discussion started by: akash_mahakode
4 Replies

7. Solaris

Permission denied message for parent directory

Hi All, I have an issue that's eating my head for few days. I would appreciate if anyone could help me out in this to resolve this. In Solaris 8 container I am facing the below issue. As oracle user when I do ls -l in /dboracle mountpoint getting permission denied error messages. $ ls... (3 Replies)
Discussion started by: Sreerag446
3 Replies

8. UNIX for Dummies Questions & Answers

bad interpreter: Permission denied

I am writing an expect script but am getting a bad interpreter: permission denied error. I don't think the error has anything to do with expect itself, I think I am missing something in how I start the file. For instance, when I run the file under the expect directory it works: cd... (7 Replies)
Discussion started by: earnstaf
7 Replies

9. UNIX for Dummies Questions & Answers

Why ' Permission denied' when executing a command?

Hi All, When I execute a command on Unix and it says 'Permission denied'. What could be the reason and how can it be resolved? Many thanks, David (2 Replies)
Discussion started by: david_wang
2 Replies

10. Shell Programming and Scripting

/bin/sh: bad interpreter: Permission denied

today i started the LFS book (version 4.0). Basically i am using slackware 9.0 to try and install a new linux completely from source on another partition. Now i took the book's recommendations and created a user called lfs so i wouldn't have to do the stuff as root, and i have got the new LFS... (4 Replies)
Discussion started by: Calum
4 Replies
Login or Register to Ask a Question