Hacker News new | past | comments | ask | show | jobs | submit login

I agree, in general, but I do think it is worth pointing out that bash is very good at what it was made for---i.e., starting processes, redirecting their output, etc.

Compare:

  { a; b && c; } ≫ log.txt
With the same written in Python:

  from subprocess import check_call, CalledProcessError
  
  f = open("log.txt", "a+")
  
  try:
      check_call(["a"], stdout=f)
  except CalledProcessError as e:
      pass
  
  try:
      check_call(["b"], stdout=f)
      check_call(["c"], stdout=f)
  except CalledProcessError as e:
      exit(e.returncode)
  
  exit(0)
(Note: I took these examples from an article I wrote a while back about programming languages https://innolitics.com/articles/programming-languages/ )



That's why Xonsh exists !




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

Search: