I have a script that connect to a Network device. It runs some commands and basically I want to output the SSH commands that are being executed.
To make myself clearer, I connect to one device, execute the commands "execute fmscript showlog " and it shows some output. The thing is in the log file where the output is redirected, I can't see the "execute fmscript etc." command printed into the file, just the results.
sshpass -p 12345678 ssh admi[email protected] 'execute fmscript showlog FG300D-1' > output.txt
And this is the result:
FMG-VM64-KVM # Starting log (Run on device) FG300D-1 $ fnsysctl ps -A PID UID GID STATE CMD
On the first line you can see FMG-VM64# What I want to see is "FMG-VM64#execute fmscript showlog FG300D-1".
Any way of doing this? I tried with tee with no success.