2012/8/17 Chet Ramey <chet.ra...@case.edu>: > On 8/16/12 9:17 AM, 郑文辉(Techlive Zheng) wrote: >> I was trying to reload the bash history file which changed by another >> bash session with the following commands, but it wouldn't work, please >> help me, why? >> >> ``` >> new_history=$(history -a /dev/stdout) >> history -c >> history -r >> echo "$new_history" | history -r /dev/stdin >> ``` > > One possible cause that springs to mind is the fact that the `history -r' > at the end of the pipeline is run in a subshell and cannot affect its > parent's history list. > > > > -- > ``The lyf so short, the craft so long to lerne.'' - Chaucer > ``Ars longa, vita brevis'' - Hippocrates > Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/
So, How could I accomplish this kind of thing?