My implementation:
I have a script Caller.sh that runs in the background that continuously calls the following scripts:
createtext.sh
createtext2.sh
createtext3.sh
Each of these scripts does the following (but with different text file names):
#! /bin/bash
LogFiletmp="getinfotmp.txt"
LogFile="getinfo.txt"
ssh admin@localhost "show all" > $LogFiletmp #this output is redirect to a temp file
mv $LogFiletmp $LogFile
I have other scripts that read getinfo.txt, but at times, the text file is empty for up to a couple seconds...Does anybody know why? getinfo.txt should always have something in it and the mv command should work pretty fast right?