Search Results

Search: Posts Made By: vomv1988
3,864
Posted By vomv1988
here's what I meant ...
here's what I meant
https://github.com/vomv1988/bash_IPC
2,877
Posted By vomv1988
I didn't know that! Thanks for the info.
I didn't know that! Thanks for the info.
3,864
Posted By vomv1988
No, you see: I haven't tried to "write one byte...
No, you see: I haven't tried to "write one byte at a time", what I'm trying to do is READ one byte at a time. cat ${INPUT} is not "in the grab_a_byte" function, it's in the listen function. cat...
2,877
Posted By vomv1988
Printf transforms \x0a into \x00
If

printf '\x0a' | xxd -cols 1produces

0000000: 0a .then, why does

printf '%c' "`printf '\x0a'`" | xxd -cols 1produce

0000000: 00 .??
3,864
Posted By vomv1988
Ok, I rewrote the whole script, and came up with...
Ok, I rewrote the whole script, and came up with this:

#!/bin/bash

# Functions:

function makedir() {
DIR_NAME=${1}
if test -e "${DIR_NAME}" -a ! -d "${DIR_NAME}" ; then
...
3,864
Posted By vomv1988
I tried this very code and I am still getting the...
I tried this very code and I am still getting the undesired behavior from my original post. It's funny how the amount of bytes I get from FIFO seems to be system-dependent; more specifically, it...
3,864
Posted By vomv1988
I'm currently using bash in a mac, but I was...
I'm currently using bash in a mac, but I was testing the code from the original post also in GNU/Linux, in bash too.

I see how several unterminated instances of the 'listen' section would cause...
3,864
Posted By vomv1988
The output is the same with that change, but...
The output is the same with that change, but thanks for trying anyway. After removing the sed filter from the original script I posted, the output looks something like:

y: print next byte
n:...
3,864
Posted By vomv1988
Grab exactly one byte from a FIFO, at random intervals
I want to develop a script of the following form:

#!/bin/bash

# Function 'listen' opens a data stream
# which stores all incoming bytes in
# a buffer, preparing them to be
# grabbed by a...
2,021
Posted By vomv1988
thanks, bakunin
This bit...
...inspired me to search for "make stdout unbuffered bash" in google, which led me to a stack overflow thread...
2,021
Posted By vomv1988
wrapper script design for gnu ed text editor i/o
Hi. I'm having trouble writing a wrapper script for the command line text editor gnu ed (http://www.gnu.org/software/ed/).

I want to be able to run the following algorithm on ed:

1. Display, on...
15,857
Posted By vomv1988
Ahhh... so the trick is in the timing then......
Ahhh... so the trick is in the timing then... Nice one.

---------- Post updated 03-27-12 at 12:57 PM ---------- Previous update was 03-26-12 at 03:08 PM ----------

I recently found this unusual...
15,857
Posted By vomv1988
Yes, in a way, they are, and you are correct to...
Yes, in a way, they are, and you are correct to state that the functionality of the original script is not altered by their absence. My intention in putting them there was only to emphasize how a...
15,857
Posted By vomv1988
I agree with your mkfifo sugestion, but in...
I agree with your mkfifo sugestion, but in regards to my usage of (), let me explain:

Suppose you want to extract a fixed amount of data, say, 20 bytes, from a device file which spits data out in...
5,886
Posted By vomv1988
I would recommend Bruce Blinn's "Portable shell...
I would recommend Bruce Blinn's "Portable shell programming, an extensive collection of bourne shell examples", along with Seebach's "Portable Shell Scripting: From Novice to Professional" and,...
5,886
Posted By vomv1988
The UNIX philosophy, precept #9, by Mike Gancarz
Always remember to "Make every program a filter":

script.sh:
#!/bin/bash

proc ()
{
while read -r line
do
typeset -i count=`echo -E "$line" | tr ' ' '}' | wc...
15,857
Posted By vomv1988
Excellent point. Then, maybe something like: ...
Excellent point. Then, maybe something like:
#!/bin/bash

TMPFIFO="/tmp/fifo.$$"

mknod $TMPFIFO p

(
echo 'value' > $TMPFIFO &
)

VARIABLE=`cat $TMPFIFO`
rm $TMPFIFO


Thank...
15,857
Posted By vomv1988
How to export a variable from a subshell to the parent shell?
A not-too-ugly solution to this classic problem...
#!/bin/bash

mknod fifo p

(
echo 'value' > fifo &
)

VARIABLE=`cat fifo`
rm fifo
Whatdcha think? Good? No good?
Showing results 1 to 18 of 18

 
All times are GMT -4. The time now is 08:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy