I want to execute a script which is located on different machines. On each machine there is a set of files which the script should scan. I have something like this but it does not work:
for host in machine{11..14}; do ssh -q user@$host;
for i in $(ls -1 ~/current/nohup_node_?.out_202407*);
do ~/bin/duration.sh $i;
done;
done
the command just logins but doesn't find the file:
ls: cannot access '../nohup_node_?.out_202407??_??': No such file or directory
for i in $(ls ...)
withfor i in ~/...
. 2) The error doesn't really match the path given in the script. If you log onto one of these machines, does thels
work? 3) It might be worth looking into ansible.~/current/nohup_node_?.out_202407*
,../nohup_node_?.out_202407??_??
or~/current/nohup_node_?.out
. So what is it now?for
loop to run on the remote machine?