Skip to main content
with date option
Source Link
Archemar
  • 32.3k
  • 18
  • 75
  • 107

Found the solution by myself :)

./telnet.sh | telnet > /tmp/top.txt 

./telnet.sh | telnet > /tmp/top.txt In this way I redirect the command to an output file. However, I have to run the same script many times and I don't want overwrite the same file, but I would create and incremental file (good idea would be renamed with DATE command). Any suggestion?

to use a date option

./telnet.sh | telnet > /tmp/top-$(date +%Y%m%d-%T).txt

Found the solution by myself :)

./telnet.sh | telnet > /tmp/top.txt In this way I redirect the command to an output file. However, I have to run the same script many times and I don't want overwrite the same file, but I would create and incremental file (good idea would be renamed with DATE command). Any suggestion?

Found the solution by myself :)

./telnet.sh | telnet > /tmp/top.txt 

In this way I redirect the command to an output file. However, I have to run the same script many times and I don't want overwrite the same file, but I would create and incremental file (good idea would be renamed with DATE command).

to use a date option

./telnet.sh | telnet > /tmp/top-$(date +%Y%m%d-%T).txt
Source Link
Federi
  • 963
  • 8
  • 28
  • 40

Found the solution by myself :)

./telnet.sh | telnet > /tmp/top.txt In this way I redirect the command to an output file. However, I have to run the same script many times and I don't want overwrite the same file, but I would create and incremental file (good idea would be renamed with DATE command). Any suggestion?