Unsolved beyond bash shell scripting, what language should I use
-
@jaredbusch said in beyond bash shell scripting, what language should I use:
So I have a need to move a few scrips beyond basic bash shell scripts.
Typical OS is Fedora ecosystem, second most used is Debian.
The script will need to execute other applications like
ffmpeg
andscp
/rsync
.What language should I use?
I assume the first answer will be
python
, which I am not a fan of, but can use.
Maybego
? Seriously open to suggestions.There is no general answer to your question.
The real question is what are you trying to accomplish that shell scripts can't or doesn't do a good job at? And what's the most suitable language/languages for that task?
For example when you say "execute other applications" that implies shell scripts because that is what they do best. If you wanted to use ffmpeg libraries for encoding, decoding and such that would have been a totally different thing and shell scripts would'nt have been an option.
-
@pete-s said in beyond bash shell scripting, what language should I use:
For example when you say "execute other applications" that implies shell scripts because that is what they do best. If you wanted to use ffmpeg libraries for encoding, decoding and such that would have been a totally different thing and shell scripts would'nt have been an option.
Shell or other, you are always calling another application to do something, with a little logic around it.
One example is re-encoding my library. I ripped my DVD collection ~10 years ago and X265/HEVC was not a thing, so it is all X264.
I don't want to bother getting my DVD boxes out as they are buried deep on the shelves in the garage. So I want to re-encode it.
I have a script that grabs all the files in a directory, then checks for it to be 265 already.
then renames and rencodes it with some hard coded language settings. I have one file for Japanese, another for English.
Sure the process works, but a real language will go much farther into proper routines and functions to let it handle things with one script.
-
@pete-s said in beyond bash shell scripting, what language should I use:
There is no general answer to your question.
There is. Just because you cannot see it doesn't mean it does not exist.
Each person's answer of a language is a general answer. Their reason for the recommendation allows me to see if it fits my need and skill and desire.
-
@jaredbusch said in beyond bash shell scripting, what language should I use:
@pete-s said in beyond bash shell scripting, what language should I use:
There is no general answer to your question.
There is. Just because you cannot see it doesn't mean it does not exist.
Each person's answer of a language is a general answer. Their reason for the recommendation allows me to see if it fits my need and skill and desire.
It might be an excuse to give Golang a whirl.
-
@obsolesce said in beyond bash shell scripting, what language should I use:
@jaredbusch said in beyond bash shell scripting, what language should I use:
@pete-s said in beyond bash shell scripting, what language should I use:
There is no general answer to your question.
There is. Just because you cannot see it doesn't mean it does not exist.
Each person's answer of a language is a general answer. Their reason for the recommendation allows me to see if it fits my need and skill and desire.
It might be an excuse to give Golang a whirl.
I have never done anything with it but I know @stacksofplates has done a bunch with it.
-
While searching for alternatives to bash scripting, I noticed people mentioning Perl, Python, Go and Ruby.
-
@jaredbusch said in beyond bash shell scripting, what language should I use:
@obsolesce said in beyond bash shell scripting, what language should I use:
@jaredbusch said in beyond bash shell scripting, what language should I use:
@pete-s said in beyond bash shell scripting, what language should I use:
There is no general answer to your question.
There is. Just because you cannot see it doesn't mean it does not exist.
Each person's answer of a language is a general answer. Their reason for the recommendation allows me to see if it fits my need and skill and desire.
It might be an excuse to give Golang a whirl.
I have never done anything with it but I know @stacksofplates has done a bunch with it.
Yeah it all depends. Prob the best option for this use case is to choose based on the libraries available for what you want to do.
However if you just want a binary you can ship around easily then Go is a great choice.
-
Another plus for Go here is concurrency. Go makes concurrency really easy.
-
@stacksofplates said in beyond bash shell scripting, what language should I use:
Prob the best option for this use case is to choose based on the libraries available for what you want to do.
I assume that anything people recommend today would have most libraries.
But that is part of why I ask. -
@jaredbusch said in beyond bash shell scripting, what language should I use:
@stacksofplates said in beyond bash shell scripting, what language should I use:
Prob the best option for this use case is to choose based on the libraries available for what you want to do.
I assume that anything people recommend today would have most libraries.
But that is part of why I ask.Yeah it depends. I've run into situations where the library might exist but it's garbage to use or just didn't exist, but you're right its not the norm anymore.
After spending the past 9-10 months writing microservices in Python I don't mind it. I used to not like it at all. This looks promising for Python:
https://github.com/kkroening/ffmpeg-python
This one for Go:
-
This post is deleted! -
@jaredbusch said in beyond bash shell scripting, what language should I use:
I assume the first answer will be python, which I am not a fan of, but can use.
Like it or hate it, I'd still recommend Python3 every time for this.
-
@black3dynamite said in beyond bash shell scripting, what language should I use:
While searching for alternatives to bash scripting, I noticed people mentioning Perl, Python, Go and Ruby.
Yeah. Ruby is nice to write but... it isn't installed universally like Python (not that P3 is universal, but much closer to it.) I like Ruby way more than most people, and even I don't use it.
Perl... OMG I hate Perl.
Go is great as a language. But like Ruby, not installed generally. And fewer resources. If it was a greenfield new OS, yeah, Go for sure. But for practical reasons, Python I think.
-
@scottalanmiller said in beyond bash shell scripting, what language should I use:
Go is great as a language. But like Ruby, not installed generally. And fewer resources. If it was a greenfield new OS, yeah, Go for sure. But for practical reasons, Python I think.
As these are systems that I control, there is no reason Go cannot be installed.
Between your comments and prior ones from @stacksofplates I think I might try Go in order to learn it.
-
@jaredbusch said in beyond bash shell scripting, what language should I use:
@scottalanmiller said in beyond bash shell scripting, what language should I use:
Go is great as a language. But like Ruby, not installed generally. And fewer resources. If it was a greenfield new OS, yeah, Go for sure. But for practical reasons, Python I think.
As these are systems that I control, there is no reason Go cannot be installed.
Between your comments and prior ones from @stacksofplates I think I might try Go in order to learn it.
You normally wouldn't install it anyway as it's not a scripting language. You'd just compile your binary and ship that to your systems.
-
@stacksofplates said in beyond bash shell scripting, what language should I use:
@jaredbusch said in beyond bash shell scripting, what language should I use:
@scottalanmiller said in beyond bash shell scripting, what language should I use:
Go is great as a language. But like Ruby, not installed generally. And fewer resources. If it was a greenfield new OS, yeah, Go for sure. But for practical reasons, Python I think.
As these are systems that I control, there is no reason Go cannot be installed.
Between your comments and prior ones from @stacksofplates I think I might try Go in order to learn it.
You normally wouldn't install it anyway as it's not a scripting language. You'd just compile your binary and ship that to your systems.
I completely misunderstood that about Go. Okay, I will do a bit of checking and decide what I want to do.
-
@jaredbusch said in beyond bash shell scripting, what language should I use:
@stacksofplates said in beyond bash shell scripting, what language should I use:
@jaredbusch said in beyond bash shell scripting, what language should I use:
@scottalanmiller said in beyond bash shell scripting, what language should I use:
Go is great as a language. But like Ruby, not installed generally. And fewer resources. If it was a greenfield new OS, yeah, Go for sure. But for practical reasons, Python I think.
As these are systems that I control, there is no reason Go cannot be installed.
Between your comments and prior ones from @stacksofplates I think I might try Go in order to learn it.
You normally wouldn't install it anyway as it's not a scripting language. You'd just compile your binary and ship that to your systems.
I completely misunderstood that about Go. Okay, I will do a bit of checking and decide what I want to do.
oh sorry, I figured you knew. That's why I never look at it, I don't want to deal with binaries in that way. But nothing wrong with that. Write it on your machine at home, compile, ship binary. Works just fine.
-
@scottalanmiller said in beyond bash shell scripting, what language should I use:
@jaredbusch said in beyond bash shell scripting, what language should I use:
@stacksofplates said in beyond bash shell scripting, what language should I use:
@jaredbusch said in beyond bash shell scripting, what language should I use:
@scottalanmiller said in beyond bash shell scripting, what language should I use:
Go is great as a language. But like Ruby, not installed generally. And fewer resources. If it was a greenfield new OS, yeah, Go for sure. But for practical reasons, Python I think.
As these are systems that I control, there is no reason Go cannot be installed.
Between your comments and prior ones from @stacksofplates I think I might try Go in order to learn it.
You normally wouldn't install it anyway as it's not a scripting language. You'd just compile your binary and ship that to your systems.
I completely misunderstood that about Go. Okay, I will do a bit of checking and decide what I want to do.
oh sorry, I figured you knew. That's why I never look at it, I don't want to deal with binaries in that way. But nothing wrong with that. Write it on your machine at home, compile, ship binary. Works just fine.
As fixed tasks, this is not a bad solution. So I will keep it in mind.
-
@jaredbusch said in beyond bash shell scripting, what language should I use:
@scottalanmiller said in beyond bash shell scripting, what language should I use:
@jaredbusch said in beyond bash shell scripting, what language should I use:
@stacksofplates said in beyond bash shell scripting, what language should I use:
@jaredbusch said in beyond bash shell scripting, what language should I use:
@scottalanmiller said in beyond bash shell scripting, what language should I use:
Go is great as a language. But like Ruby, not installed generally. And fewer resources. If it was a greenfield new OS, yeah, Go for sure. But for practical reasons, Python I think.
As these are systems that I control, there is no reason Go cannot be installed.
Between your comments and prior ones from @stacksofplates I think I might try Go in order to learn it.
You normally wouldn't install it anyway as it's not a scripting language. You'd just compile your binary and ship that to your systems.
I completely misunderstood that about Go. Okay, I will do a bit of checking and decide what I want to do.
oh sorry, I figured you knew. That's why I never look at it, I don't want to deal with binaries in that way. But nothing wrong with that. Write it on your machine at home, compile, ship binary. Works just fine.
As fixed tasks, this is not a bad solution. So I will keep it in mind.
Right, no big deal in this case.