Setting Echo Off


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Setting Echo Off
# 1  
Old 02-05-2009
Setting Echo Off

Hi

How to set the ECHO off in shell scripts so that the default output will be hidden.
# 2  
Old 02-05-2009
Sound like BASIC Smilie
You need to send stdout to /dev/null
Code:
echo "test" 1>/dev/null

# 3  
Old 02-05-2009
To set it for the whole script, put in this somewhere at the beginning
Code:
exec 1>/dev/null

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Difference between echo `ls -l` and echo "`ls -l`" ?

Hi guys, Been messing around with shell programming for a couple of days and I found something that was pretty odd in the behavior of the echo command. Below is an example-: When I type the following in my /home directory from my lxterminal in Debian-: echo "`ls -l`" I get the... (2 Replies)
Discussion started by: sreyan32
2 Replies

2. Solaris

Is there a difference between setting a user as nologin and setting it as a role?

Trying to figure out the best method of security for oracle user accounts. In Solaris 10 they are set as regular users but have nologin set forcing the dev's to login as themselves and then su to the oracle users. In Solaris11 we have the option of making it a role because RBAC is enabled but... (1 Reply)
Discussion started by: os2mac
1 Replies

3. Shell Programming and Scripting

tcsh - understanding difference between "echo string" and "echo string > /dev/stdout"

I came across and unexpected behavior with redirections in tcsh. I know, csh is not best for redirections, but I'd like to understand what is happening here. I have following script (called out_to_streams.csh): #!/bin/tcsh -f echo Redirected to STDOUT > /dev/stdout echo Redirected to... (2 Replies)
Discussion started by: marcink
2 Replies

4. Shell Programming and Scripting

echo **

Hi, The current directory has two files: a, b. echo ** gets the result a b, instead of a b a b. I don't understand this. Can someone give some explanation? Thanks! (2 Replies)
Discussion started by: jianma
2 Replies

5. Shell Programming and Scripting

echo

hi, i am facing an issuse in echo with double quates " " . while read i do uid=`echo $i | awk '{print $3}'` login=`echo $i |awk '{print $2}'` name=`echo $i | awk '{print $1}'` echo "/usr/sbin/useradd -u $uid -g 200 -d /local/home/$login -m -s /bin/ksh -c "/"$name_CRQ"/" $login "... (6 Replies)
Discussion started by: sudharson
6 Replies

6. Shell Programming and Scripting

With that logic this echoes "echo". Question about echo!

echo `echo ` doesn't echoes anything. And it's logic. But echo `echo `echo ` ` does echoes "echo". What's the logic of it? the `echo `echo ` inside of the whole (first) echo, echoes nothing, so the first echo have to echo nothing but echoes "echo" (too much echoing :P):o (2 Replies)
Discussion started by: hakermania
2 Replies

7. UNIX for Dummies Questions & Answers

How to correctly use an echo inside an echo?

Bit of a weird one i suppose, i want to use an echo inside an echo... For example... i have a script that i want to use to take users input and create another script. Inside this script it creates it also needs to use echos... echo "echo "hello"" >$file echo "echo "goodbye"" >$file ... (3 Replies)
Discussion started by: mokachoka
3 Replies

8. Shell Programming and Scripting

Difference between using "echo" builtin and /bin/echo

So in my shell i execute: { while true; do echo string; sleep 1; done } | read line This waits one second and returns. But { while true; do /bin/echo string; sleep 1; done } | read line continues to run, and doesn't stop until i kill it explicitly. I have tried this in bash as well as zsh,... (2 Replies)
Discussion started by: ulidtko
2 Replies

9. Shell Programming and Scripting

Wierd behaviour setting stty echo

Hi all, Encountered a wierd behaviour which I am unable to understand. I have a function doing the follow: function RETRIEVE_PASSWORD { if (( $DC_ACCOUNT )) then clear printf "\nEnter Password for ${ConfiguredUser}" printf... (1 Reply)
Discussion started by: srage
1 Replies

10. Shell Programming and Scripting

setting width in echo statement

Hello All, I need to set the width or number of columns for my dynamic output in the echo statement. statement is like: echo " <output> " here the <output> is dyamice and can be of any number of characters, the " " should always start in same column everytime it is... (4 Replies)
Discussion started by: s123.radha
4 Replies
Login or Register to Ask a Question