The problem is that the desired result is 18 bytes for the output of this code
echo The echo "hello is hi" echo
but the script above only produces 17 bytes
if i add more echos
`
echo The
echo "hello is hi"
echo
echo
`
it should increment the bytes count e.g. 19bytes, but the program seems not count the bytes after the text and just remains at 17 bytes no matter what
example.sh
case "$1" in 0) echo The echo "hello is hi" echo ;; *) echo the echo echo "hello is hi" esac
myshell.sh
output=$(echo "$test_input" | ./"$filename" $test_args) output_bytes=$(echo "$output" | wc -c) echo $output_bytes
filename would be example.sh $test_args is empty $test_input would be 0
xy yx is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.