Differences

This shows you the differences between two versions of the page.

Link to this comparison view

shell2 [2019/12/17 16:40]
dblume search is hanging on shell page. This is a test page.
shell2 [2019/12/22 09:40] (current)
dblume move telnet tip to telnet wiki page
Line 274: Line 274:
     fi     fi
 } }
-</code> 
- 
-Note the use of $@ vs "$*" in the next function that automatically saves an archive of a telnet session. Also note that I remove spaces and colons. (Colons because they screw with opening files directly at line numbers). 
- 
-<code bash> 
-telnet_log() { 
-    curtime=$(date -Iseconds | tr : .) 
-    args=$(echo "$*" | tr ' ' '_') 
-    telnet $@ | tee $HOME/telnetlog/$args\_${curtime::-5}.log 
-} 
- 
-last_telnet_log() { 
-    ls -d1t $HOME/telnetlog/* | head -n 1 
-} 
-</code> 
- 
-Of course if you do that, you'll want to occasionally (via cronjob?) delete old archives. 
- 
-<code> 
-find $HOME/telnetlog/ -type f -mtime +6 -delete 
 </code> </code>
  
shell2.1576629652.txt.gz · Last modified: 2019/12/17 16:40 by dblume
 
Recent changes RSS feed Driven by DokuWiki