I have the following script. It prints all of first characters to console from passwd, but my expectation was to get only one character and for the program to then terminate.#!/bin/sh cat /etc/passwd |while read -r linedo    echo ${line} |        grep -o . |        while read char        do            echo ${char}               exit 1               donedoneActual output:rbda(etc)Expected output:r
Why does the exit command not exit from nested while loop?
shell script