7

There was a question raised about whether How does “top” command show live results? belongs here, or if questions about shell scripting should fall under the domain of programming and stay on SO. I'm on the fence, since shell scripting is a strictly *nix concern (my personal on-topic test), but it's also firmly in the domain of programming

Thoughts?

6

The general attitude on Meta Stack Overflow (which is serving as the meta for all general Stack Exchange stuff) is that overlap is fine. We don't have to avoid stepping on Stack Overflow toes.

Therefore, I'd suggest that Unix-specific programming questions are on topic here and SO. I don't even know which would be the better place to ask. SO is great for programming advice, but it does tend to be Windows/.NET dominated, and lots of Unix/Linux users are very familiar with shell scripting and the like.

There are a lot of questions that could be programming or non-programming questions, and I wouldn't like to see those closed for being programming questions. Similarly, I wouldn't want to see follow-up questions turned away.

Moreover, I'd like to avoid the Super User problem. It was originally defined as what didn't belong on SO or SF, and now has evolved additional restrictions. I can give you a quick guide to what belongs on Stack Overflow or Server Fault in a sentence, but I can't do that with Super User (unless it's a seriously run-on sentence). I think this has hurt its development. I'd like this site to cover everything specifically Unix/Linux.

2

(This is my first post on meta, not sure about the etiquette).

I agree with xenoterracide's conclusion that "the real answer here is to play it on a case by case scenario" but I do think that is is possible to have some general guidelines. Here is my thinking so far:

  1. Shell scripting can't be strictly off topic. The heavy use of shell scripts in the standard SysV init setup alone (not to mention cron and countless other .d's) make shell scripts an essential part of *nix systems.

  2. If the question can be reduced to a question that is essentially about 'filters' it is on topic. i.e. "How can I write a script to create a unique list of logged in users"; possible answer(shamelessly stolen from info coreutils toolbox:

    who | cut -c1-8 | sort | uniq

    this type of filtering is essential to using a unix system

  3. If the question is not shell specific but could be about any programming language, then it is off topic and likely better for SO.

  4. If the question is only incidentally about shell scripting. Often a persons shell script will be failing because some specific command they are trying to run isn't working. In this case, the question reduces to a question about the command and is on topic.

  5. If the question is just about shell scripting, I think it should be off topic. By this I mean, I don't think questions about shell scripts that aren't really interacting with the system should be on topic. For instance, I personally think that this question: bash-eval-array-variable-name, is probably better suited for SO, because anyone reading the question and answer didn't really learn anything about unix.

Not to go too far off topic, but I think that whatever decision we make here could easily also influence discussions of whether other common scripting language (namely, perl) are on topic--unless that discussion already occurred.

2

I think that Shell Programming questions are perfectly appropriate here. I would actually prefer that this site be the main repository for Shell Scripting questions, because I have trouble navigating the noise at SO. Even https://stackoverflow.com/questions/tagged/shell is sometimes filled with distracting questions which are only tangentially shell-related. But I know that SO will dominate the Shell Scripting arena for now.

The line between the Unix OS and Shell Scripting is blurry. Shell scripting is essentially a bunch of Operating System commands which are strung together. Maybe this is in a script or maybe this is a one-liner at your prompt.

This is different then C programming, where gethostbyname(3) can only be used within the program, after compilation, etc.

However, advanced shell scripting questions will receive more responses at SO. But sometimes the questions are asked in a System Administration context, whereas the answers at SO are largely from a programming context.

1

I also can't think of any solid guideline that could be generally followed as this is 'offtopic'. Technically the title of the question is fine, it's the 'how to do it' that's the problem. But then again... that's because I know the "how to is 'curses'" if I didn't know that... I might not have a problem with the question.

My ultimate decision is that the question itself is not offtopic, however the answer is better served by SO. Sometimes you ask a question and don't know that until you get an answer.

Like here: Q: How do I make a program like Top A: Curses this requires a follow up question that's offtopic. Q: How do I use Curses with $language? A: Offtopic ask on SO.

If you don't know that this involves more advanced programming to start then you might not realize the end result is not appropriate on unix SE.

I wonder though... should we modify the question, or something to pose that a follow up should be on SO?

As far as Shell Programming in general I think it depends... I have no problems with simple scripting... much like the questions I've been asking. But when you get into writing a lot of functions, complexity or external library use, then I'd say it goes to SO. Truthfully the problem here is that the shell is a fundamental part of Unix. The fact that you can do everything to the system via CLI that you could via GUI is a part of what makes Unix great. I'm certainly ok with 'scripting' but it's hard to tell where shell scripting ends and shell programming begins.

I think the real answer here is to play it on a case by case scenario.

update When in doubt it's unix

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .