05-21-2009
cp output /dev/null results in not a directory
Hello,
I am working on a script to measure the read performance of a busybox environment. The logical choice is to use a command line like:
(time cp * /dev/null) 2> /tmp/howlong.txt
Ah, the rub is cp or /dev/null will only accept a single file at a time.
The result in the txt file is and output list that basically shows /dev/null/filename Not a directory.
I tried the same with using dd if=* of=/dev/null bs=1M, alas the results were similar.
I tried using a for loop, but I could not get time to work with syntax errors.
Example:
Works:
for FILE * cp $FILE /dev/null ; done
Fails:
(time for FILE * cp $FILE /dev/null ; done) 2> /tmp/howlong.txt
Any help here would be appreciated.
Thanks,
-Steve
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
Q1-What does
nroff -ms > /dev/null
Q2- What does mean -A under STAT column :
ps aux |head -20
UTIL PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND
root 516 93,0 0,0 12 12 - A 04 nov 3906:51 wait
Thank you. (4 Replies)
Discussion started by: big123456
4 Replies
2. Solaris
Please help urgently.
I need to setup up some sort of service on a solaris server on a port.
I dont need it do anything special, anything that is sent to this port from an external server should be dump to /dev/null or a flat file..
Can you help urgently? (1 Reply)
Discussion started by: frustrated1
1 Replies
3. Shell Programming and Scripting
hello all,
In many shell scripts i found '> /dev/null' , i am not able to get this,
will any one please explain why we are using this.
thanks
sudha (2 Replies)
Discussion started by: rrs
2 Replies
4. Solaris
Hi, Anyone can help
My solaris 8 system has the following
/dev/null , /dev/tty and /dev/console
All permission are lrwxrwxrwx
Can this be change to a non-world write ??
any impact ?? (12 Replies)
Discussion started by: civic2005
12 Replies
5. Ubuntu
I stumbled across a somewhat strange behavior of tar and find no explanation for it: i was testing a DVD for read errors and thought to simply tar the content and direct the output to /dev/null:
tar -cvf - /my/mountpoint/*ts > /dev/null
This way i expected the system to read the complete... (4 Replies)
Discussion started by: bakunin
4 Replies
6. Shell Programming and Scripting
Hello,
I'm trying to send the error output of a 'cat' operation to /dev/null like this:
cat /dirA/dirB/temp*.log > /dirA/dirB/final.log 2>/dev/null
This works perfectly in a terminal, but not when placed in a script.
If there are no files matching temp*.log the script outputs an error... (7 Replies)
Discussion started by: Nils88
7 Replies
7. UNIX for Dummies Questions & Answers
How are these two different? They both prevent output and error from being displayed. I don't see the use of the "&"
echo "hello" > /dev/null 2>&1
echo "hello" > /dev/null 2>1 (3 Replies)
Discussion started by: glev2005
3 Replies
8. Shell Programming and Scripting
I apologize if this question has been answered else where or is too elementary.
I ran across a KSH script (long unimportant story) that does this:
if ; then
CAS_SRC_LOG="/var/log/cas_src.log 2>&1"
else
CAS_SRC_LOG="/dev/null 2>&1"
fithen does this:
/usr/bin/echo "heartbeat:... (5 Replies)
Discussion started by: jbmorrisonjr
5 Replies
9. Shell Programming and Scripting
I'm using an text-to-speech synthesis in a script, and I need to redirect it's output to /dev/null
how can I do that ? And how to redirect the stream to his normal output then (sound card ) ?
thankx (2 Replies)
Discussion started by: firelink
2 Replies
10. Shell Programming and Scripting
Hello All and a Happy New year to yous guys.
I'm running the below command on my AIX box and it keeps giving me the message that the file doesn't exist. I know the file don't exist, but I don't want to see the error. 2>/dev/null doesn't work.
bash-3.00$ ls -l C* | wc -l 2>/dev/null
ls:... (2 Replies)
Discussion started by: bbbngowc
2 Replies
MEM(4) Kernel Interfaces Manual MEM(4)
NAME
mem, kmem - main memory
SYNOPSIS
major device number(s):
raw: 1
minor device encoding:
mem: 0; kmem: 1; null: 2
DESCRIPTION
Mem is a special file that is an image of the main memory of the computer. It may be used, for example, to examine (and even to patch) the
system.
Byte addresses in mem are interpreted as physical memory addresses. References to non-existent locations cause errors to be returned.
The file kmem is the same as mem except that kernel virtual memory rather than physical memory is accessed. Only kernel virtual addresses
that are mapped to memory are allowed. Examining and patching device registers is likely to lead to unexpected results when read-only or
write-only bits are present.
On PDP-11s, the I/O page begins at location 0160000 of kmem and the per-process data segment for the current process begins at 0140000 and
is USIZE clicks (64 bytes each) long.
FILES
/dev/mem
/dev/kmem
/dev/MAKEDEV script to create special files
/dev/MAKEDEV.local script to localize special files
BUGS
On PDP-11's, specifying an odd kernel or user address, or an odd transfer count is [generally] slower than using all even parameters.
On machines with ENABLE/34(tm) memory mapping boards the I/O page can be accessed only through kmem.
3rd Berkeley Distribution January 28, 1988 MEM(4)