I am trying to
chmod -R 644 /tmp/work/* in bash script, however I get following error:
#!/usr/bin/env bash shopt -s extglob set -eu mkdir -p /tmp/work/ chmod -R 777 /tmp/work/ sftp -o StrictHostKeyChecking=accept-new user1@hostname1:/tmp/test* /tmp/work/ chmod -R 644 /tmp/work/* chmod: cannot access '/tmp/work/*': No such file or directory
While I try to run the same command in shell with the same user, it runs successfully.
Seems like issue with shell is due to glob expansion? so I have set
shopt -s extglob right before the
chmod command in bash, but still getting the same error.
Any ideas what am I doing wrong?