Sponsored Content
Top Forums UNIX for Advanced & Expert Users Cmd 'cat /dev/urandom' not closing cleanly Post 302996550 by MadeInGermany on Thursday 27th of April 2017 07:11:05 AM
Old 04-27-2017
You are right that head should send a SIGPIPE to fold that should send a SIGPIPE to tr that should send a SIGPIPE to cat.
And each program in the chain should terminate.
It's not reliable though, a signal *can* get lost, especially if the system is very busy. If this also happens on an idle system then there is a bug somewhere (in one of the programs or in the shell's pipe handling).
In one of my old scripts (using /bin/sh for many LUnix platforms) I had limited it with
Code:
dd if=/dev/urandom dd bs=1 count=12000 | tr ...

and, for safety, if the resul string was too short, I repeated it in a loop.
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

/dev/urandom

Hi, how do I use /dev/urandom to generate a single number between 1-100? I can od /dev/urandom but it gives me an endless list of random numbers, I just want 1 between 1-100. How can I get that? Thanks. (12 Replies)
Discussion started by: Takumi
12 Replies

2. Solaris

What is /dev/tty /dev/null and /dev/console

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

3. UNIX for Dummies Questions & Answers

cat /dev/null

Hi, Excuse my ignorance here - I'm a networks man and my knowledge of all things unix is somewhat limited. We have a very large file (/var/tmp/mond.log) that we need to zero - does the "cat /dev/null > /var/tmp/mond.log" command achieve this? (4 Replies)
Discussion started by: freakydancer
4 Replies

4. Slackware

Can't play sound files with aplay or cat to /dev/dsp

I am having problems using soundes. Until a few moments ago the following commands produced errors and no sound: cat /usr/share/apps/kolf/sounds/blackhole.wav/ > /dev/dsp yielded: /dev/dsp: Invalid argument cat /usr/share/apps/kolf/sounds/blackhole.wav > /dev/audio yelded: /dev/audio:... (3 Replies)
Discussion started by: slak0
3 Replies

5. Shell Programming and Scripting

Error output of cat to /dev/null

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

6. Shell Programming and Scripting

Memory fault(coredump) while using cat cmd

i have few log files that are input to my perl script... i am executing the script as below cat RTR*.log | test.pl and getting the following error -ksh: 25014: Memory fault(coredump) cat: write error: Connection reset by peer can anyone help me on this.... Thanks in... (2 Replies)
Discussion started by: niteesh_!7
2 Replies

7. UNIX for Beginners Questions & Answers

Cleanly log out a user w/o killing process

My AIX-based accounting program runs an end-of-day process that requires all users to be logged out. Sometimes I have a user that leaves for the day and forgets to logout. Is there any way I can cleanly log a user out without killing their process? (4 Replies)
Discussion started by: DLS1701
4 Replies

8. HP-UX

Dev/urandom and dev/random missing in HP-UX

Hi, In our HP-UX B.11.11. I could not find dev/urandom and dev/random Are all pseudo-devices implemented as device drivers, or in need to run /configure some package to install the package to have dev/urandom. Please help (4 Replies)
Discussion started by: rashi
4 Replies
Tcl_SignalId(3TCL)					      Tcl Library Procedures						Tcl_SignalId(3TCL)

__________________________________________________________________________________________________________________________________________________

NAME
Tcl_SignalId, Tcl_SignalMsg - Convert signal codes SYNOPSIS
#include <tcl.h> CONST char * Tcl_SignalId(sig) CONST char * Tcl_SignalMsg(sig) ARGUMENTS
int sig (in) A POSIX signal number such as SIGPIPE. _________________________________________________________________ DESCRIPTION
Tcl_SignalId and Tcl_SignalMsg return a string representation of the provided signal number (sig). Tcl_SignalId returns a machine-readable textual identifier such as "SIGPIPE". Tcl_SignalMsg returns a human-readable string such as "bus error". The strings returned by these functions are statically allocated and the caller must not free or modify them. KEYWORDS
signals, signal numbers ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWTcl | +--------------------+-----------------+ |Interface Stability | Uncommitted | +--------------------+-----------------+ NOTES
Source for Tcl is available on http://opensolaris.org. Tcl 8.3 Tcl_SignalId(3TCL)
All times are GMT -4. The time now is 03:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy