LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-01-2004, 10:12 AM   #1
valadamir
LQ Newbie
 
Registered: Dec 2004
Posts: 2

Rep: Reputation: 0
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`
 
Old 12-01-2004, 10:27 AM   #2
LasseW
Member
 
Registered: Oct 2004
Distribution: Fedora 7, OpenSuse 10.2
Posts: 108

Rep: Reputation: 15
Put quotes round the echo argument like this:

echo "`ls $option $directory`"
 
Old 12-01-2004, 10:37 AM   #3
valadamir
LQ Newbie
 
Registered: Dec 2004
Posts: 2

Original Poster
Rep: Reputation: 0
nm, I got it.


remove the echo AND the back ticks.


ls $option $directory


^works.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic bash script question kevpatts Linux - Newbie 3 10-12-2005 01:02 PM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
Trouble with a basic bash script Tengil Linux - Newbie 5 03-04-2004 12:59 PM
Basic BASH script, what's wrong??? Satriani Linux - General 2 06-02-2003 05:34 PM
help with basic syntax in bash script Supp0rtLinux Linux - Software 4 03-27-2003 06:57 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration