GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Embed Notice

HTML Code

Corresponding Notice

  1. Embed this notice
    pistolero (p@fsebugoutzone.org)'s status on Thursday, 09-Jul-2026 19:19:21 JSTpistoleropistolero
    in reply to
    • ✙ dcc :pedomustdie: :phear_slackware:
    • NonPlayableClown
    • DOKTOR G'HUL
    • :segasaturn:
    • Encyclopædia Autistica (Order Now!)
    • MK-ULTRA
    • touch fluffy tail (Heroic) :verified:
    • Sharia
    • SilverDeth
    • ins0mniak ~Hate Account~
    • Her Menstruating Testes 🇮🇳
    • 🌈ᚩ🌈
    • EconomicHitman
    • Some call me Prodigal, some call me Waerloga . . .
    • Yomiel
    • YaboiSugoi :archlinux: :verified:
    • ​
    • GhostOfMoshe
    • CMD
    • ​
    • di0nysius the patomskyite
    • sicp
    • Tsubo F. Neujarr
    • erős pista
    • Växẍ Säbbäth
    • ins0mniak
    • no shire no life
    • Organ Ism
    • JVKO Radio
    • reboot_brain
    • Impeccata
    @yaboisugoi @DiamondMind @Economic_Hitman @GhostOfMoshe @Godsend @JVKO @Mombi @NonPlayableClown @SilverDeth @TheBoonieGhoul @VaxxSabbath @bonifartius @ceo_of_monoeye_dating @dcc @dorkvalized @fish @fluffy @freemayonnaise @ins0mniak @ins0mniak @mrsaturday @nimt @pista @rebootbrain @samwise @sicp @takao @thebitchisback @tsubo @w0rm @yomiel If you run them in screen/dtach/tmux that is a little easier. But you can also have a bash prompt hook save the history to ~/tmp/bash.$pid.hist every time it prompts you. But that requires doing it ahead of time. This would solve that:

    :mycomputer: ps auxw | awk -v "p=$$" 'BEGIN{while(p != 1){no[p]++;f=sprintf("/proc/%d/stat",p);getline < f;close(f);p=$4}} $1==ENVIRON["USER"] && !no[$2] && $11~/bash/{cmd=sprintf("kill -HUP %d && cp %s/.bash_history %s/tmp/bash.%d.hist", $2, ENVIRON["HOME"], ENVIRON["HOME"], $2);print cmd}'

    The BEGIN block starts with its own pid (set by -vp=$$), then walks up until it gets to init, marking the pids; this is to avoid killing its own shell. (You could just nohup the awk process but it'll still end up killing the parent shell.) Then it checks if the process is running as the same user, isn't on the blacklist, and is bash or at least the first argument has "bash" as a substring, then it prints what it would do. You could change `print cmd` to `system(cmd)` and it'd just execute it. The idea is we just send SIGHUP to all of the bash processes and then copy their history to ~/tmp.
    In conversationabout 22 days ago from fsebugoutzone.orgpermalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.