how to suppress dd output?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to suppress dd output?
# 1  
Old 03-07-2010
how to suppress dd output?

I have to stop the output of dd from writing to terminal. Here is the command:
Code:
sudo dd if=boot1h of="/dev/r$temp1"

Here is the output:
Code:
2+0 records in
2+0 records out
1024 bytes transferred in 0.000804 secs (1273715 bytes/sec)

I have tried >> log.txt but it doesn't work. Is there another way to stop this output?
# 2  
Old 03-07-2010
Hi.

The output you see goes to standard error, so:

Code:
sudo dd if=boot1h of="/dev/r$temp1" 2> /dev/null

should get rid of it.
# 3  
Old 03-07-2010
Thanks for the replay. I was just reading about suppressing to the null device. This works for me:
Code:
sudo dd if=boot1h of="/dev/r$temp1" >& /dev/null

For future reference, can you explain the difference between the two methods (<& and 2>)?
# 4  
Old 03-07-2010
I believe that
Code:
blah >& outfile

is shorthand for
Code:
blah > outfile 2>&1

(but I think it's a bash thing, and I never use it, or bash, so...)
# 5  
Old 03-08-2010
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

[Solved] Suppress do you wish to overwrite (y or n)?

Hi all, as i have to deal every day with .log and also .csv files, i would like to know if there is any way to suppress "do you wish to overwrite (y or n)?" prompt with the option no for all prompts, the command i usually run is the following, find... (2 Replies)
Discussion started by: charli1
2 Replies

2. Shell Programming and Scripting

How to suppress error in following command?

I have a file containing data in multiple columns. The colums are seperated by pipe (|). I need to extract information as below: myfile_20130929_781;10;100.00 where myfile.txt is the file name. 10 is the number of records in the file starting with 120 and 100.00 is the sum of 26th field of... (16 Replies)
Discussion started by: angshuman
16 Replies

3. Shell Programming and Scripting

How to selectively suppress perl output?

The following perl statement in a bash script consists of two substatements. I intend the first perl substatement (the assignment with glob) to get input from the preceding bash pipe, and the second perl substatement (the foreach loop) to output back to bash. However, the first perl substatement... (7 Replies)
Discussion started by: LessNux
7 Replies

4. Shell Programming and Scripting

Suppress the output of ping

Hi All, I just wanted to know, is there a way to suppress the output of the following i.e. the output should not be written on the screen: ping 10.1.23.234 -n 1 PING 10.1.23.234: 64 byte packets 64 bytes from 10.1.23.234: icmp_seq=0. time=0. ms ----10.1.23.234 PING Statistics---- 1... (2 Replies)
Discussion started by: ss_ss
2 Replies

5. Shell Programming and Scripting

suppress the Connection text

Hi Guys, I am calling a function from my script. The function has to return only one value which is the year. But in the function, i am having connecting statement to the database. The connection information is coming along with the year variable. I want to suppress the connecting... (1 Reply)
Discussion started by: mac4rfree
1 Replies

6. Shell Programming and Scripting

suppress unzip queries

hey i have piece of code working in solaris and same code i want to deploy it in linux but in solaris its not asking for queris but in linux it is !!!! COMMAND ==> unzip $test/alter.war -d $webclientHome/. OUTPUT==> In solaris it proceeds with following traces replace /aa/test.txt?... (4 Replies)
Discussion started by: crackthehit007
4 Replies

7. Shell Programming and Scripting

how to suppress list number from history command output

i run history command and I want to eliminate the list number. So far this perl script works as long as the list is a exact 3 character long. cat dd | perl -pe 's,\d{3},,' 70 export JAVA_HOME=. 81 export JAVA_HOME=. 82 export JAVA_HOME=`pwd` export JAVA_HOME=`pwd` ... (1 Reply)
Discussion started by: soemac
1 Replies

8. Shell Programming and Scripting

flags to suppress column output, # of rows selected in db2 sql in UNIX

Hello, I am new to db2 SQL in unix so bear with me while I try to explain the situation. I have a text file that has the contents of the where condition that I am using for a db2 SQL in UNIX ksh. Here is the snippet. if ; then echo "Begin processing VALUEs" ... (1 Reply)
Discussion started by: jerardfjay
1 Replies
Login or Register to Ask a Question