I don't want output in one line, I want output just like a normal command.
ls -l
total 8
-rw-r--r-- 1 shubhamtatvamasi staff 0B Sep 3 13:33 file1
-rw-r--r-- 1 shubhamtatvamasi staff 0B Sep 3 13:33 file2
-rw-r--r-- 1 shubhamtatvamasi staff 0B Sep 3 13:33 file3
-rw-r--r-- 1 shubhamtatvamasi staff 0B Sep 3 13:33 file4
-rwxr-xr-x 1 shubhamtatvamasi staff 37B Sep 3 13:34 test.sh
script
cat test.sh
#!/bin/bash
LS=$(ls -l)
echo ${LS}
./test.sh
Out is comming in one line
total 8 -rw-r--r-- 1 shubhamtatvamasi staff 0 Sep 3 13:33 file1 -rw-r--r-- 1 shubhamtatvamasi staff 0 Sep 3 13:33 file2 -rw-r--r-- 1 shubhamtatvamasi staff 0 Sep 3 13:33 file3 -rw-r--r-- 1 shubhamtatvamasi staff 0 Sep 3 13:33 file4 -rwxr-xr-x 1 shubhamtatvamasi staff 37 Sep 3 13:34 test.sh