Tag Info

New answers tagged

1

POLLNVAL is set if the file descriptor number does not correspond to a file descriptor. I don't know for sure why this behavior was chosen rather than having poll return an error. The reason may have been ease of implementation: it allows the implementation to loop over the array of struct pollfd a single time, without having to cope with an early return ...


1

Based on what I'm reading it seems as though Postfix is inherently single threaded but gives off the appearance of multi-threading through being able to run multiple instances on the same server to essentially achieve the same thing. https://groups.google.com/forum/#!topic/mailing.postfix.users/DAcPHrLygAc A quick walkthrough is available here: ...


2

If compatibility with "all Unix systems" is an absolute requirement -- and if it isn't, why are you writing a shell script? -- then, yes, you should be using #! /bin/sh, because Bash is not guaranteed to be installed anywhere, let alone in /bin. It's actually much, much worse than that. If you need compatibility to all Unix systems, that includes things ...


7

For starters, if you can make the assumption that Bash is preinstalled (which, to my knowledge is the case on all the systems you list), use the following hashbang to be compatible: #!/usr/bin/env bash this invokes whatever bash happens to be configured, no matter whether it's in /bin or /usr/local/bin. While on most systems across a wide range ...


4

Yes, both OSX and Linux will come with /bin/bash. You should be perfectly safe. However, that is not POSIX. The POSIX shell is at /bin/sh on most (all?) systems and that is the most portable approach and the only way to be POSIX compatible. Note that while on many systems /bin/sh points to bash, on others it can point to different shells. It's a symlink to ...


7

In Debian and Ubuntu, /bin/sh is dash, which is a POSIX-compliant shell. If you specify #!/bin/sh, you must limit yourself to POSIX statements in your script. (The advantage being that dash starts faster than bash, so your script can get its job done in less time.) On many (most?) other Linux systems, /bin/sh is bash, which is why many scripts are written ...


1

So it's high-time this question had an answer, and, though I eventually intuitively worked out the how to do this correctly in pretty much every case some time ago, I only very recently managed to fairly concrete that understanding with the text in the standard. It's actually stated there fairly simply - I just stupidly overlooked it many times, I guess. ...



Top 50 recent answers are included