User Tools

Site Tools


docs:tips_n_tricks:shellskripting.html

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
docs:tips_n_tricks:shellskripting.html [25.08.2019 12:15 CEST]
peter [Append to history in script (bash)]
docs:tips_n_tricks:shellskripting.html [25.08.2019 12:55 CEST] (current)
peter [Append to history in script (bash)]
Line 310: Line 310:
 exit 0 exit 0
 </​code>​ </​code>​
 +
 +==== Variant 1 ====
  
   ~ $ date   ~ $ date
Line 321: Line 323:
   ~ $ echo 'Super langer Befehlt aus Skript'​ Sat Aug 24 14:14:01 CEST 2019   ~ $ echo 'Super langer Befehlt aus Skript'​ Sat Aug 24 14:14:01 CEST 2019
  
 +==== Variant 2 ====
 +
 +  ~ $ alias addhist='​export=HISTFILE=`mktemp` ; /​full/​path/​to/​addhist.sh ; history -r ; rm "​$HISTFILE"​ ; export HISTFIL=~/​.bash_history'​
 +  ~ $ date
 +  Sat Aug 24 14:13:57 CEST 2019
 +  ~ $ addhist
 +  ~ $ date
 +  Sat Aug 24 14:14:11 CEST 2019
 +  ~ $
 +  [Key ↑]
 +  ~ $ echo 'Super langer Befehlt aus Skript'​ Sat Aug 24 14:14:01 CEST 2019
 +  ​
  
 ====== ​ ====== ====== ​ ======
docs/tips_n_tricks/shellskripting.html.txt · Last modified: 25.08.2019 12:55 CEST by peter