While going through many answers on Unix & Linux, I came across many of them writing their contents and or tags with POSIX or Bash or some other standard Linux shell.

I know of some differences like some of them have arrays and some do not, and other system level differences which I am not completely aware of.


  • Which one of them is the most widely used?

  • In which should we go into for advanced scripting? (Editor's note: This is opinion-based, so I struck this point out to make this question on-topic here)

What are the things that matter for a Bash script writer to begin scripting in another shell?


Your question is too big to answer in anything but general terms.

POSIX is a family of operating system interface standards; you generally write code / run utilities in a conformant fashion when you want your application to run across a wide variety of Unix-ish systems. As popular as the GNU binutils and bash are, they are not used universally, so sticking to POSIX-conformant functions, flags and utilities can save you some headaches when the time comes to move an app from say Linux to Mac OS.

"Advanced scripting" isn't descriptive enough to recommend a language, but if what you're doing mostly is running programs and using other program to process the results, the shell is the right tool for that. I don't think it matters much which shell you use, since the usual ones are all portable and can be built and installed along with your app. But if you're using data structures beyond one-dimensional arrays, you should be using a language that more easily manipulates such structures, e.g. Perl.

|improve this answer|||||

Which one of them is the most widely used?


is the most popular for common tasks not requiring portability.


is the only way to make your script portable.

What portability means

It means to be able to run your script on almost any Linux, and alike-platforms such as Cygwin or Android. Though, be aware that it requires some skill to be able to script POSIX-ly. Examples are out of the scope of this Q & A. Feel free to look around U & L.

|improve this answer|||||
  • bash can run in POSIX compliant mode "bash --posix" at your bash command prompt will enter this mode. to exit, simply type "bash" again, in your terminal. Bash is intended to be a conformant implementation of the Shell and Utilities portion of the IEEE POSIX specification (IEEE Standard 1003.1). Bash can be configured to be POSIX-conformant by default. (according to the "man bash" description) – user12711 Aug 17 '19 at 4:34

POSIX is a standard defining how a POSIX-compliant OS (like linux) should behave/work.

As for shell scripting, "sh" was the default command interpreter, nowadays it is usaully a link to another interpreter (bash, ksh...). The core functionnalities of each of them is the same, but each has their specificities (in terms of functionnality, syntax...).

I think, the most widely used is bash, but this is based on my experience.

|improve this answer|||||

Not the answer you're looking for? Browse other questions tagged or ask your own question.