How to execute the shell scipt?
When I ran my script using:
jalaj@jalaj-SVF14212SNB sudo ./startvpn.sh
[sudo] password for jalaj:
sudo: unable to execute ./startvpn.sh: Permission denied //It says
When I execute this using sudo sh startvpn.sh [sudo] password for jalaj:
I get the output as
startvpn.sh: 2: startvpn.sh: spawn: not found
startvpn.sh: 3: startvpn.sh: expect: not found
startvpn.sh: 4: startvpn.sh: expect: not found
startvpn.sh: 5: startvpn.sh: interact: not found
Below is my script
#!/usr/bin/expect
spawn openconnect --no-cert-check 103.194.44.2
expect -exact "Username:"send -- "XYX\n"
expect -exact "Password:"send -- "XYX%"
interact
I checked the above permission using
-rwxrw---x 1 jalaj jalaj 168 Aug 10 12:29 startvpn.sh
It say users jalaj
can execute but I am not able to execute.
Can anyone guide me how to execute the script?