02-19-2012
A while loop with redirection or piped input reads from stdin. Ssh by default also reads stdin and ends up reading the remainder of the data intended for the while.
Add -n to your ssh command to prevent it from reading from stdin.
Last edited by agama; 02-19-2012 at 11:40 PM..
Reason: clairity
This User Gave Thanks to agama For This Post:
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello All,
Request you to let me know how to do the below urgently..
Requirement
File A Contains:
for i in file A
DEV1
DEV5
STG1
STG5
File B Contains:
for j in file B
DEV1
DEV5
STG1
STG5 (3 Replies)
Discussion started by: kaushikraman
3 Replies
2. Shell Programming and Scripting
hi all,
i have a while loop which i am using to read lines into an array:
k=0
exec 10<file
while read LINE <&10; do
ARRAY=$LINE
((k++))
done
exec 10>&-
echo ${ARRAY}
for some reason when i display the array it is not showing the last row in the file.
any help appreciated. (1 Reply)
Discussion started by: npatwardhan
1 Replies
3. Shell Programming and Scripting
So, I want to read line-by-line a text file with unknown number of files....
So:
a=1
b=1
while ; do
b=`sed -n '$ap' test`
a=`expr $a + 1`
$here do something with b etc
done
the problem is that sed does not seem to recognise the $a, even when trying
sed -n ' $a p'
So, I cannot read... (3 Replies)
Discussion started by: hakermania
3 Replies
4. Shell Programming and Scripting
I have written a script to read the file line by line.
It is reading and printing the lines.
But it is coming out of loop before reading last line.
So I am not able to print last line.
How do I solve it. (6 Replies)
Discussion started by: dgmm
6 Replies
5. Shell Programming and Scripting
Hi,
Need some help...
I want to execute sequence commands, like below
test1.sh
test2.sh
...etc
test1.sh file will generate log file, we need to search for 'complete' string on test1.sh file, once that condition success and then it should go to test2.sh file, each .sh scripts will take... (5 Replies)
Discussion started by: rkrish123
5 Replies
6. Shell Programming and Scripting
Hello Team,
i have to read line by line in a while loop, and the input file has:.
# The script will start cppunit test application to run unit tests.
-LD_LIBRARY_PATH=$CPPUNIT_HOME/lib:\
+LD_LIBRARY_PATH=$VOBTAG/SS_UnitTest/lib:\
$VOBTAG/SS_BFD/BFDSCLI/build:\
... (7 Replies)
Discussion started by: chandana hs
7 Replies
7. Shell Programming and Scripting
Hi,
I want to read a live log file line by line and considering those line which start from time stamp;
Below code I am using, which read line but throws an exception when comparing line that does not contain error code
tail -F /logs/COMMON-ERROR.log | while read myline; do... (2 Replies)
Discussion started by: ketanraut
2 Replies
8. Shell Programming and Scripting
Hello,
I'm using RHEL 5.1 with bash. How to handle "read" inside while loop reading every line? Please see below:
# cat /tmp/passwd_sample
CARRJ12:qVSn4ja4mFA72,..:20021:125:JULIAN CARR:/home/everyone:/bin/bash
HERCOT01:NK/3j2ZB4ZC7Q:20022:125:TOM HERCOCK:/home/everyone:/bin/bash... (4 Replies)
Discussion started by: reddyr
4 Replies
9. Windows & DOS: Issues & Discussions
I am trying to have the below batch file do following two things:
1. only allow the values YES,yes,Y,y, or NO,no,N,n
2. increment the counter %var1 only if answer to question 2 is "y" and not able to get the syntax correct. If %var1%=1 then I am trying to display function :end. Thank you :).... (0 Replies)
Discussion started by: cmccabe
0 Replies
LEARN ABOUT DEBIAN
jack-stdin
JACK-STDIN(1) General Commands Manual JACK-STDIN(1)
NAME
jack-stdin - write JACK audio data to stdin
SYNOPSIS
jack-stdin [OPTIONS] port1 [ port2 ...]
DESCRIPTION
jack-stdin reads raw audio data from standard-input and writes it to a JACK audio port.
The number of given ports detemine the number of audio channels that are used. If more than one channel is given, the input audio-sample
data needs to be interleaved.
OPTIONS
-b, --bitdepth BITS
Specify the bit-depth of each sample. For integer-encoding this can be 16 or 24. The default is 16. This setting is only used for
integer encoding: Floating-point samples will always be 32 bit wide.
-d, --duration SEC
Specify the time for which jack-stdin should run in seconds. A value less than 1 means to run indefinitely. The default is 0 which
reads until end-of-file.
-e, --encoding FORMAT
Set the input format of the data: signed-integer, unsigned-integer, floating-point (default: signed)
-f, --file FILENAME
Read data from given file instead of standard-input.
-h, --help
Print a brief usage information
-p, --prebuffer PERCENT
Pre-fill the buffer before starting audio output to JACK (default 50.0%). NOTE: disable pre-buffering (-p 0) or use a small buffer
size to play back very short samples.
-L, --little-endian
The input-data is in little-endian byte-order or native-byte-order float (this is the default)
-B, --big-endian
Interpret input audio data in big-endian byte-order or swap the byte-order of floating-point.
-q, --quiet
Inhibit usual output. This affects information and buffer-overflow warnings but not setup-errors.
-S, --bufsize SAMPLES
Choose the internal buffer-size in samples. The default size is 65536. The given value will be multiplied by the number of channels
and bit-depth to get the size of the ring-buffer. Note: the buffersize must be larger than JACK's period size.
EXAMPLES
jack-stdout vlc_31994:out_1 vlc_31994:out_2
| sox -t raw -r 48k -e signed -b 16 -c 2 -
-t raw -r 48k -e signed -b 16 -c 2 -
tremolo 5 100
| ./jack-stdin system:playback_1 system:playback_2
cat /dev/dsp
| jack-stdin system:playback_1 system:playback_2
KNOWN ISSUES
jack-stdin is not suitable to play-back files shorter than twice the jack-period size.
AUTHOR
Robin Gareus <robin@gareus.org>.
SEE ALSO
http://jackaudio.org/,
30 March 2011 JACK-STDIN(1)