Два процесса с идентичным PID после вызова fork

Цитируйте ваши переменные и используйте IFS = с чтением, как это:

displayLine(){ printf '%s\n' "$line"; }

filename="infile"

while IFS= read -r line
do
    displayLine "$line"
done < "$filename"
-1
28.03.2019, 11:11
1 ответ

Идентификаторы процессов уникальны.

Согласно документации POSIX fork():

DESCRIPTION

The fork() function shall create a new process. The new process (child process) shall be an exact copy of the calling process (parent process) except as detailed below:

  • The child process shall have a unique process ID.
  • The child process ID also shall not match any active process group ID.
  • The child process shall have a different parent process ID, which shall be the process ID of the calling process.

...

4
28.01.2020, 05:07

Теги

Похожие вопросы