I have seen a number of users voting to close scripting questions as off topic. Is this the community consensus? Are bash questions not welcome here? How about other shell programming questions?
The help center states that (emphasis mine):
Using and administering official Ubuntu flavors including: Edubuntu, Ubuntu GNOME, Kubuntu, Ubuntu Kylin, Lubuntu, Mythbuntu, Ubuntu Studio, Xubuntu, Ubuntu Touch and Ubuntu MATE.
Shell scripting is an essential part of administering (and using, really) a Linux system. Including Ubuntu.
We also have a meta discussion that has been well accepted and which states that:
Bash is the default shell on Ubuntu. Shell scripting is an integral part of managing a Linux system. I believe that all bash related questions are on-topic, even the ones that have to do clearly with programming tasks like how to add 1 to a variable.
As far as I can tell, these all mean that bash questions, any bash questions are welcome and on topic here. This should also apply to any other shell since they are all basic Linux tools and are easily available on Ubuntu. In any case, bash most certainly is on topic.
To illustrate, we currently have
- 2,848 questions tagged with bash
- 83 questions tagged with zsh
- 21 questions tagged with one of ksh,tcsh or csh.
- 46 questions tagged with scripting
- 537 questions tagged with shell-scripting
- 1,553 questions tagged with scripts
- 1,722 questions tagged with python
- 139 questions tagged with perl
So, in conclusion, yes shell scripting questions are perfectly on topic and welcome here. Please stop closing such questions as off topic.
As terdon says, bash scripting differs from some other programming tasks in that writing shell scripts is a core part of system administration on Ubuntu and other Unix-like operating systems. Not every Ubuntu user writes or needs to write their own shell scripts, but bash scripting is a topic is central to system administration on Ubuntu. Furthermore, there is enormous overlap between bash usage and bash scripting. Even users who rarely or never write scrips are likely use the bash shell (in the terminal) sometimes.
Bash is so central to Ubuntu, I doubt a universal rule about all programming questions has to be articulated to clarify that bash is on-topic. I'm not objecting to having such a rule--I just think bash being on-topic is much more clear cut.
When you open a Terminal window, that's bash. (Unless you have changed your shell.) A huge number of answers to a wide variety of questions about different Ubuntu topics advise to run commands in a Terminal, and those commands are run by bash. We often comment to ask users to run bash commands to gather missing information for their questions, as well. To declare bash scripting off-topic for this site would, it seems to me, be extreme and inadvisable.
Questions about running a bash script on Ubuntu are thus virtually always on-topic for this site, unless some completely unrelated factor makes them off-topic.
- A bash scripting question that's attempting to report a bug rather than ask a question would be off-topic, just like any other bug report.
- If someone who isn't using Ubuntu at all asks a bash scripting question, that would be off-topic.
But there's nothing about the topic of bash scripting that makes a question any more likely to be off-topic, compared to questions about any other core Ubuntu-related topic.
Furthermore, even in the cases where a bash scripting question happens to be off-topic for an unrelated reason, the actual reason for closure should be made clear, so people are not misled about our policies or about the technical relationship between Ubuntu and the bash shell.
I think one of the reasons users are sometimes inclined to try to push bash scripting questions off the site is that there are several Stack Exchange sites where such questions are on-topic. Sometimes reviewers think a question would have been better asked elsewhere, even if it is strictly speaking on topic here. But there are at least four problems with closing bash questions for that reason:
- Bash is a critically important part of Ubuntu, and people should feel (and be) welcome to ask questions about it here.
- We don't have a policy that such questions are off-topic. I hope we never have such a policy, but even if one day we do, we don't right now and it is a misuse of the system to close on-topic questions based on one's personal preferences.
- Users experienced on Ask Ubuntu often don't know when a question would be a better fit for another site. For example, sometimes someone posts a bash question that is poorly researched or unclear and is told in comments to ask it on Stack Overflow. But without modifications the question would not be welcome there; even if it needs to be closed here, we should not simply advise them to go ask it there. This doesn't help the OP, and is actively bad for Stack Overflow.
- When a question is on-topic on the site where it is asked, network-wide policy says we should not push it off to another site.
Respecting your own community
As members of a community, your first loyalty should be to that community. When evaluating a question, you shouldn’t be looking to push it off on some other site; instead, ask if it could be appropriate and on-topic for you, the experts who the author decided to ask. Be a bit jealous of your site – don’t blithely turn askers away simply because their question could be asked somewhere else. Don’t hit them over the head with your scope, help them tailor their question to fit into it – and if that means your site’s scope overlaps a bit with another site’s, so be it.
stackexchange's "related questions" sidebar only works per-site. Having bash questions scattered around is a bad thing, isn't it?
Currently, there's shell stuff on
- stackoverflow: 50,496 tagged questions, 5,610 unanswered
- unix: 5,870 tagged questions, 355 unanswered
- askubuntu: 2,873 tagged questions, 380 unanswered
It looks like users are mostly asking questions in the right places. (except for shell programming questions still on stackoverflow, now that unix has been created).
Ubuntu-admin scripting questions on this site, like How do I force nmcli to reconnect to different uuid? on askubuntu, while Unix attract general shell programming stuff like like https://unix.stackexchange.com/questions/196885/bash-eq-vs-and-bc-output-type.
So mostly the bash questions asked here do belong here.
The problem I see is that shell-programming questions are getting split between stackoverflow and unix. Even though stackoverflow has the many valuable answered questions about shell programming, I think Unix is the best site for them. As terdon pointed, shell scripting is really Unix's speciality.
stackoverflow still attracts recent shell programming questions, like https://stackoverflow.com/questions/29707776/bash-replace-two-variables-in-order-with-loop, that would be best on Unix.
I'd like to see shell programming questions that aren't specific to Ubuntu or to sysadmin in general moved to unix. Esp. if the question is more "how to get the shell to do what I want?" (where the answer is a clever use of a for loops, cut, sed, awk, or similar). Questions asking about Ubuntu (or generic Unix) sysadmin tasks that happen to be best accomplished by shell scripting are fine here. Questions like "what should I get the shell to do? (to accomplish this sysadmin goal)".
I'd just like to see the shell programming questions (like, clever uses for for loops, or for bash arrays) all go on the same site.
This probably isn't a popular view here, but I think I don't see why there's an askubuntu, AND a Unix & Linux. Couldn't everything from this site just go on unix.stackexchange without making it hard to find ubuntu-specific stuff, and without burying the non-Ubuntu questions? Maybe the answer is no, but having the "related questions" sidebar miss out on good stuff because someone asked it on another site isn't ideal.