I'm trying to get a line number with the following code, where beta.plist is on the remote machine.
lineNum="$(awk '/bundle-version/{ print NR; exit }' ~/beta.plist)" \
When executing on a remote client through ssh it is giving me the error 'No Such File Or Directory'. I'm assuming this is because it's trying to use my local directory instead of the remote directory, because of the command substitution, but I'm not sure how to tell it to use the remote directory instead. I've tried many things from various SO posts, but none worked. Both machines are Macs if that makes a difference.
Code:
ssh -t host "cd path-to-file; \
lineNum="$(awk '/bundle-version/{ print NR; exit }' ./beta.plist)""
Error Message:
awk: can't open file ./beta.plist source line number 1