Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • I'm getting a binary operator error after the ssh step but this is essentially what I want -- thanks! The error is test: /remote/path/example.txt: binary operator expected. Commented Sep 13, 2017 at 18:57
  • ssh [email protected] test -e "$file" && ((ok++)) should be ssh [email protected] 'test -e "$file" && ((ok++))' Forgot quotes :P Commented Sep 13, 2017 at 19:01
  • Single-quoting the entire thing will prevent expansion of $file Commented Sep 13, 2017 at 19:18
  • Single quoting actually does not work for me -- the ANSWER ABOVE works: ssh [email protected] test -e "$dir/$date/$file" && ((ok++)). My array would not take my file_list i.e. files=($file_list) so I had to explicitly define that array. Commented Sep 13, 2017 at 19:28