01-10-2017
Hmmm, quite some questions in one post. And, I can't comment for all thoses OSes nor all shells, nor on shellcheck. For bash on linux and FreeBSD,
- You can have any number of redirections in a command line any place; they're evaluated left to right, and the last one will be effective. Check what >/tmp/1 cat file1 > /tmp/2 > /tmp/3 does.
- In your line > /dev/null 2>&1 cat /tmp/noise.raw > /dev/dsp it might be interesting to check where the error msgs go. What be your first guess?
- You don't need a command nor a NOP; >/tmp/1 will just open the file, empty it, and close it. This can be (and is) used to effectively create an empty file.
- That shellcheck comment seems to be a warning, not an error. shells allow for that construct.
- Your conclusion about non-existence of /dev/dsp from the permission error might be incorrect.
6 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
i need to get rid of lilo's splash screen.
i've heard that you can edit your /etc/lilo.conf and add this line:
<b>append="splash=0"</b>
anyway, i did that and i still have a splash screen. any idea why that didn't work, or what is another way to disable the splash screen?
okay,
-nydel (1 Reply)
Discussion started by: nydel
1 Replies
2. Programming
So basically what im trying to do is ...
Open file, read that file, than try to find ..
We or we and replace them with I, but not replace the cases where words contain We or we, such as Went, went, etc
a and replace them with the, but not replace the cases where words contain a, such as... (1 Reply)
Discussion started by: bconnor
1 Replies
3. Programming
Hey guys, first of all I'd like to say Hi to everyone. I am new here and this is my first post.
I have a question about some C stuff. I am in Computer Science and I have an assignment for a UNIX Applications course. It is really complicated, however.
We're using the C language for this and... (1 Reply)
Discussion started by: V4D3R
1 Replies
4. UNIX for Advanced & Expert Users
hi,
i need to clear data off a DOA backup drive.
i try this, but just get a file {} in . and no change on the backup drive.
bash shell
find /mnt/usbbackup -xdev -type f -exec echo `date` > {} \;
any ideas? thanks. :) (1 Reply)
Discussion started by: drewnichols
1 Replies
5. UNIX for Dummies Questions & Answers
Hi everyone
Just a couple of quick questions if I may.
Can I ask what is meant by "flavours"?? I've come across it many times in the forums and I'm guessing that it is a variery of either Linux or UNIX (I know nil about either) which has developed but not really got a clue.
... (1 Reply)
Discussion started by: Tiramisu
1 Replies
6. Shell Programming and Scripting
Example script:
find mydir -type f -exec echo {}>aaa \; -exec echo {}>bbb \;The two paths go the the bbb file, while there should be one of them on each file. How should I do it to get it working? (2 Replies)
Discussion started by: Tribe
2 Replies
LEARN ABOUT OPENSOLARIS
rmvb
rmvb(9F) Kernel Functions for Drivers rmvb(9F)
NAME
rmvb - remove a message block from a message
SYNOPSIS
#include <sys/stream.h>
mblk_t *rmvb(mblk_t *mp, mblk_t *bp);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
PARAMETERS
mp Message from which a block is to be removed. mblk_t is an instance of the msgb(9S) structure.
bp Message block to be removed.
DESCRIPTION
The rmvb() function removes a message block (bp) from a message (mp), and returns a pointer to the altered message. The message block is
not freed, merely removed from the message. It is the module or driver's responsibility to free the message block.
RETURN VALUES
If successful, a pointer to the message (minus the removed block) is returned. The pointer is NULL if bp was the only block of the message
before rmvb() was called. If the designated message block (bp) does not exist, -1 is returned.
CONTEXT
The rmvb() function can be called from user, interrupt, or kernel context.
EXAMPLES
This routine removes all zero-length M_DATA message blocks from the given message. For each message block in the message, save the next
message block (line 10). If the current message block is of type M_DATA and has no data in its buffer (line 11), then remove it from the
message (line 12) and free it (line 13). In either case, continue with the next message block in the message (line 16).
1 void
2 xxclean(mp)
3 mblk_t *mp;
4 {
5 mblk_t *tmp;
6 mblk_t *nmp;
7
8 tmp = mp;
9 while (tmp) {
10 nmp = tmp->b_cont;
11 if ((tmp->b_datap->db_type == M_DATA) &&
(tmp->b_rptr == tmp->b_wptr)) {
12 (void) rmvb(mp, tmp);
13 freeb(tmp);
14 }
15 tmp = nmp;
16 }
17 }
SEE ALSO
freeb(9F), msgb(9S)
Writing Device Drivers
STREAMS Programming Guide
SunOS 5.11 16 Jan 2006 rmvb(9F)