Expect doesn't have permissions

by Oren Milman   Last Updated October 11, 2018 14:02 PM

I am running an Ubuntu Server 18.04 on QEMU, and installed expect using sudo snap install expect.

From inside expect, I get permission denied for many things, e.g.:

expect1.1> ls .
/bin/ls: cannot open directory '.': Permission denied
child process exited abnormally
    while executing
"exec >&@stdout <@stdin /bin/ls ."
    invoked from within
"ls ."

But also:

expect1.2> stat .
  File: '.'
  [...]
Access: (0755/drwxr-xr-x)  Uid: ( 1000/    oren)   Gid: ( 1000/    oren)
[...]

I tried running expect using sudo expect, but got the same behavior.

Moreover, running ls .. from within expect works fine.

Why do I get the "Permission denied" error?



Related Questions


expect script to scp via an intermediate host

Updated June 10, 2017 03:02 AM

Expect command problem

Updated July 21, 2017 19:02 PM

Expect script changing send of "\\" to just "\"

Updated March 24, 2016 09:01 AM

Expect script is not working

Updated November 28, 2017 23:02 PM

Expect extra characters after close-quote

Updated December 01, 2017 12:02 PM