You can get permission denied even as root: try to write to a read-only filesystem, try to write to a special filesystem (e.g.,
/proc
or
/sys
) in a not-permitted way, try to write to a network filesystem (server does permission checks, too), etc... You haven't really given us enough information to figure out which you're seeing. What is the current working directory of
startscript.sh
? —
derobert 1 min ago