New answers tagged fork
This depends on the shell you are using. Try to call: yourshell -c 'echo bla | read VAR; echo $VAR' and check what is printed. Another check is to run: yourshell -c 'ps -f| more' with different shells and look at PID and PPID. Every shell uses its own different method.
Solution I inferred from a previous version of the documentation: /etc/supervisor/conf.d/spark_master.conf: command=/opt/spark-1.4.1/bin/spark-class org.apache.spark.deploy.master.Master directory=/opt/spark-1.4.1 /etc/supervisor/conf.d/spark_worker.conf: command=/opt/spark-1.4.1/bin/spark-class org.apache.spark.deploy.worker.Worker ...
Some experiments: $ yes | sleep 10m &  32395 32396 $ pstree -pa $(ps -o ppid= -p $(pgrep yes)) zsh,29630 ├─pstree,32402 -pa 29630 ├─sleep,32396 10m └─yes,32395 As can be seen, the parent of both processes is the shell. With a longer pipeline: $ sleep 10m | sleep 10m | sleep 10m | sleep 10m &  32320 32321 32322 32323 $ pstree -pa $(ps ...
It's the shell; as you will see via the ps command, in that case the PPID of less will be the PID of the shell. The processes ls and less haven't much in common; it's just that the stdout of the former is piped in the stdin of the latter.
Top 50 recent answers are included