Hacker Newsnew | past | comments | ask | show | jobs | submit | gkfasdfasdf's commentslogin

or even use caller to print a full backtrace: https://news.ycombinator.com/item?id=44636927

That's neat, but if your bash script needs a backtrace it should not be a bash script. To each their own though.

My bash scripts don't "need" a backtrace, but it sure is nicer than not having one

not sure what you mean, you can have separate ERR and EXIT traps that run independently.

Yeah but each only exists once. If you wanna clean up on ERR and also use that trap for debugging you need to implement some janky layer on top of the trap.

(FWIW my take away from issues like this is always: Bash is not a serious programming language. If you are running up against these limitations in real life it's time to switch language. The challenge is really in predicting when this will happen _before_ you write the big script!)


I love this feature of uv but getting linters/language servers to pick up the venv when editing the files is a bit of a pain. I currently have a script 'uv-edit' which I am using to run Neovim with the correct environment:

  #!/bin/bash
  SCRIPT="$1"; shift
  uv sync --quiet --script "$SCRIPT" && exec uv run --python "$(uv python find --script "$SCRIPT")" nvim "$SCRIPT" "$@"


That would indeed be faster, looks like it requires bash 4.2+


Why not leverage the bash 'caller' builtin? It's meant for printing stack traces, e.g.

    #!/bin/bash
    
    die() {
      local frame=0
      while caller $frame; do
        ((++frame));
      done
      echo "$*"
      exit 1
    }
    
    f1() { die "*** an error occured ***"; }
    f2() { f1; }
    f3() { f2; }
    
    f3


 Output
    
    
    12 f1 ./callertest.sh
    13 f2 ./callertest.sh
    14 f3 ./callertest.sh
    16 main ./callertest.sh
    *** an error occured ***
Via: https://bash-hackers.gabe565.com/commands/builtin/caller/


I wonder, what happens when you hook up an MCP server to a database of malicious LLM prompts and jailbreaks. Is it possible for an LLM to protect itself from getting hijacked while also reading the malicious prompts?


Great article, discussed previously on HN:

https://news.ycombinator.com/item?id=31592934 (200 comments)

https://news.ycombinator.com/item?id=37782493 (105 comments)


Just curious, how do you know your questions and the SQL aren't in the LLM training data? Looks like the benchmark questions w/SQL are online (https://ghe.clickhouse.tech/).


“Your model has memorized all knowledge, how do you know it’s smart?”


Ok so it's not Cygwin, how is it better (or worse) than Cygwin?


I think the name is just a pun. Like how GNU is short for "GNU's not Unix". Presumably MinC is short for "MinC is not Cygwin".


I hope it is faster. Homebrew operations take forever for me.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: