LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Basic Bash script help (https://www.linuxquestions.org/questions/programming-9/basic-bash-script-help-261336/)

valadamir 12-01-2004 10:12 AM

Basic Bash script help
 
For some reason this script works but the output is like:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

instead of a normal:

xxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxx

like when you just type in ls -l <directory> directly from the keyboard lets say.

edit* hah, I need 5 post to post a URL so no linky to my script.



piece of it looks like:

echo `ls $option $directory`

LasseW 12-01-2004 10:27 AM

Put quotes round the echo argument like this:

echo "`ls $option $directory`"

valadamir 12-01-2004 10:37 AM

nm, I got it.


remove the echo AND the back ticks.


ls $option $directory


^works.


All times are GMT -5. The time now is 06:36 AM.