[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: extract values from a string



On 17/04/2022 12:38, Greg Wooledge wrote:
On Sun, Apr 17, 2022 at 12:31:34PM +1200, Ash Joubert wrote:
Python is a convenient and scriptable solution for many text processing
problems. You can call it from within bash:
But you really *shouldn't*.  What's the point of writing your script
in two different languages, and having to run two different interpreters?
Just write the whole thing in Python.  (Or Perl, or Tcl, or Ruby, or
whatever language you're using that's not bash.)


Indeed! At the end of my email I wrote:


On 17/04/2022 12:31, Ash Joubert wrote:
> It depends on your workflow, but you might consider writing the whole
> thing in Python as a script with first line #!/usr/bin/python3 . Many is
> the time I rewrote a bash script in Python when I realised that I wanted
> proper types, error handling, and unit tests.


--
Ash Joubert <ash@transient.nz>
Director
Transient Software Limited <https://transient.nz/>
New Zealand


Reply to: