How to exit the interactive mode for yarn top command from within the bash script
问题 I have a bash script which is on serverA. This script will ssh to serverB and runs yarn top command, pulls the metrics and put into the file(test.txt) on serverA. Below is the command which I am using: ssh -oStrictHostKeyChecking=no -i <key> username@hostname "yarn top" | head -5 | grep -w 'Applications' | awk '{print "Pending_apps" "\t" $7}' >> test.txt So here the problem is that after my script runs above command it goes into interactive mode and it only exits when I give Ctrl+C or quit