dalecosp;11036841 wrote:
Heh heh, try "man woman" in the shell sometime
Nice one! π
dalecosp;11036841 wrote:
Good question. I'm not sure if I can answer it accurately. This could be, for example, also applicable to "(ba)sh /path/to/script.sh" ... maybe.
Keep in mind that you can also do something like '(ba)sh -c "/path/to/script > /something.else"' ... I'm not at all sure if "script" gets a shell from that one.
Oh now it makes sense: there is actually always an invocation of a shell for a shell script! Out of habit I only ever considered php scripts when they mentioned scripts even though they explicitly stated shell scripts. Taking your example, I'd say there are either one or two invocations of shells. The first would be (ba)sh which is invoked for path/to/script. A second script may be invoked, assuming that /something.else is an executeable which in turn invokes a new shell. Assuming something.else was something else, such as a non-executable writeable file, there would only be the first shell invocation. Well, these are my guesses anyway. As for "run in the background" such as "php script.php &", that would need to implicitly invoke a new non-interactive shell. Yet another guess, but the picture does seem a little clearer to me.
dalecosp;11036841 wrote:
Regarding the parens around "ba" there, I generally run a BSD and can't count on bash always being there, so I generally write scripts in sh, or Perl/Python/PHP. π
The first and minor reason for switching shells is that dash has no history, arrows generate escape sequences ( [-< ) and other similar issues. Granted, this could be because of other adjustable settings or character encoding mismatches but switching to bash solves all of these inconveniences. But the main reason for wanting bash is that there are two scripts that stopped working, both being PHP scripts. I fixed the first a while back, but today I realized that they would not have been broken in bash.
The second script just results in segfault. There might be more issues that I still have not detected though. The same code worked on redhat, although it sometimes resulted in segfault there too. It also works on my laptop running osx. The segfault is traced from a soap call to zend garbage collector I cannot say for certain that it always segfaults but it seems likely. I've "only" tried running that script manually on the Ubuntu server 5 times in a row, all resulting in segfault. On redhat, it may have once segfaulted two days in a row, but probably not. And usually ran without at most one segfault per week over several months on redhat. On my laptop I don't believe it has ever segfaulted. Still, I cannot guarantee that segfault is the only reason it fails on Ubuntu. I actually havn't yet investigated if it even starts executing with cron. All I know for sure is that it results in segfault (every time?) when run manually and that it has not run since the switch to Ubuntu 3 weeks ago.
So I'm just trying to make the new system more similar to the old one. It's the same approach I'd take if you gave me a working blue car and a broken red car and told me to fix the broken car. I'd probably start by painting it blue and see if it started workingβ¦
That they even assign the task to me seems silly though. I'm no system administrator, and this ought to be handled by someone who knows what they are doing. But I guess it's good for me. I get to learn new stuff. And paint cars. On the other hand, I would rather spend my time coding.
But I should probably consider an upgrade to php latest-stable before doing anything else since the the segfault appears when reassigning next/prev pointers in zend garbage collector or whatever the function was named.
dalecosp;11036841 wrote:
"man 1 cpuset" for the first one and "man 2 cpuset" for the second.
Thanks