i'm just getting started with shell programming.
to start with, i tried to write a script which shows the result of ls.
Code:
#! /usr/local/bin/bash
echo "beginning of ls"
`ls -l `
echo "end of ls"
exit 0
It returns
beginning of ls
./test.sh: total: command not found
end of ls
It is because "total" was outputed from "ls -l"
Thus i changed my code to `ls -l` 2>/dev/null
Although i get no errors, i get no result of "ls -l" too..
just a simple of:
beginning of ls
./test.sh: total: command not found
end of ls
How can i execute "ls -l", at the same time displaying the result on screen, without asking the shell to execute lines displayed on screen (for example : total)
Thanks