S
S
Some Ipsum2019-05-02 10:49:01
linux
Some Ipsum, 2019-05-02 10:49:01

What is better for scripts?

Which is better for scripting for linux, python or bash.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
R
Roman Kitaev, 2019-05-02
@Askar_Safiullin

It depends on the complexity, depending on the environment. If there is a python and the script is quite complex, of course it is a python. If the script is a pair of sed / awk / exec - bash. Well, if there is no python in the environment (for example, a docker container with nginx) - obviously bash.

S
Saboteur, 2019-05-02
@saboteur_kiev

Depends on the purpose of the script. The complexity of the task here is not as important as the knowledge of the language and the meaning of the application.
bash is a command language for system tasks. Convenient if you need to run external applications
Python is a universal scripting language.
For example, an installer or a control script is generally better written in bash.

C
CityCat4, 2019-05-02
@CityCat4

You need to know Bash simply because all control scripts are written on it. Without it, you will never understand why, say, there is an environment variable in this place, but not in that one. A lot of things become simple and understandable if you know it.
python - for heavier scripts, where there is, say, a database connection, complex transformations, work with LDAP / AD ... (I use perl in this case)

M
metajiji, 2019-05-02
@metajiji

I'm afraid that everything you want is already written for you, use DevOps tools for automation, such as ansible, saltstack, etc., if something simple, stop at bash.

A
Alex White, 2019-05-03
@kak2z

What do you write well on that and write)) at least in php)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question