0

Why does my program ignore newlines?

#!/bin/bash

echo -n "Input dir path : "
read path

function lshead4()
{   

    for i in 1
    do
       ls -l $path | head -4

    done
}


echo $(lshead4)
Benjamin W.
  • 46,058
  • 19
  • 106
  • 116
  • `echo "$(lshead4)"` wirth double quotes, duplicate questiom – Walter A Nov 19 '19 at 15:13
  • 1
    Possible duplicate of [File content into unix variable with newlines](https://stackoverflow.com/questions/2789319/file-content-into-unix-variable-with-newlines) – Walter A Nov 19 '19 at 15:17
  • Duplicate of [I just assigned a variable, but echo $variable shows something else](https://stackoverflow.com/questions/29378566/i-just-assigned-a-variable-but-echo-variable-shows-something-else) – Benjamin W. Nov 19 '19 at 15:27

0 Answers0