LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-27-2011, 01:04 AM   #1
Ribo01
Member
 
Registered: Aug 2010
Posts: 103

Rep: Reputation: 5
turning off "echo" in shell script.


Hello y'all. Would like to know how to turn "echo" off in a shell scripting. I wrote a shell script, testing a condition, after the condition tested. On the other line I used the echo Command to echo a line, then on the other line I used the "read" command to read an input typed. The crux here is the string or line inputed is what I would like to turn off. Hope anybody can help and understands ? Distro is redhat linux. Thanks.
 
Old 02-27-2011, 01:32 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
Can you please post your script and the output it gives you? Thank you,

Josh
 
Old 02-27-2011, 01:48 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Type "help read" and check the description you get. It has an option for not echoing the input.
 
Old 02-27-2011, 01:50 AM   #4
r_s
Member
 
Registered: May 2009
Distribution: slackware, fedora, ubuntu
Posts: 98

Rep: Reputation: 21
read -s
s is for the silent option

Last edited by r_s; 02-27-2011 at 01:53 AM.
 
1 members found this post helpful.
Old 02-27-2011, 01:53 AM   #5
r_s
Member
 
Registered: May 2009
Distribution: slackware, fedora, ubuntu
Posts: 98

Rep: Reputation: 21
sorry for double posting
 
Old 02-27-2011, 04:48 PM   #6
Ribo01
Member
 
Registered: Aug 2010
Posts: 103

Original Poster
Rep: Reputation: 5
Thank you all for the response to my post. I would like Corp769 to note that am not having any problem with my written script, am jst trying to turn my echo of and the read command off too, so when I type in a thread for my read command its does not show o the screen. So all is very well with the written script.thanks for the effort anyway. Cheers
 
Old 02-28-2011, 05:47 AM   #7
Ribo01
Member
 
Registered: Aug 2010
Posts: 103

Original Poster
Rep: Reputation: 5
Hi. Would like to thank you guys again. Hope u won get tired of my gratification and my questions . Been Able to solve my post thanks to r_s . I think he deserves my rep.thanks again you'all much love .cheers
 
  


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
[SOLVED] Errors executing shell script: "command not found" and "no such file or directory" eko000 Linux - Newbie 1 01-14-2011 08:54 AM
[SOLVED] Shell scripting, difference of "source script.sh" and "./script.sh" Squall90 Programming 4 07-31-2010 05:40 PM
[SOLVED] Silencing the line "echo test > test/test.txt" in a shell script Arenlor Linux - General 2 06-18-2010 02:37 PM
Shell script: I have string "abc____def____ghi", how to make "abc def ghi" vouser Programming 8 03-09-2010 11:01 PM
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 08:42 AM


All times are GMT -5. The time now is 05:13 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration