Цитируйте ваши переменные и используйте IFS =
с чтением, как это:
displayLine(){ printf '%s\n' "$line"; }
filename="infile"
while IFS= read -r line
do
displayLine "$line"
done < "$filename"
Идентификаторы процессов уникальны.
Согласно документации 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.
...