08-02-2013
Feed Input to a script running on bash
Hi Sir,
I am just learning bash scripting and I came across a challenge.
I need to input F11 to a script among many text inputs.
For all the text inputs i did following.
# sh test.sh < input.txt
where input.txt contains all the text inputs in new lines.
This worked fine until i came across a input which is F11 or Escape.
Please guide me how to handle this.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have wasted one working day writing this scripts.
It compares two folders and make a good tabbed report about their differences.
#!/bin/bash
function DRAW_DEPTH () {
ROUND=$1
while
do
printf %s " "
ROUND=`expr $ROUND - 1`
done
printf %s "|- "
}
function MAIN () {... (9 Replies)
Discussion started by: trutoman
9 Replies
2. Shell Programming and Scripting
Sorry Guys for not being able to explain in one of my earlier post.
I am now putting my requirement with the input file and desired output file.
In the below input file -
Transaction code is at position 31:40.
Business code is from position 318:321
TSCM00000005837 ... (7 Replies)
Discussion started by: varunrbs
7 Replies
3. Shell Programming and Scripting
Hi,
I have this script
Script.sh:
#!/bin/sh
sed 's,\,,g' input.dat > output .dat
But i want to run it witb different files. So i want the input file as an input argument to the script, how could i do that.
Running it like this:
> Script.sh input.dat (2 Replies)
Discussion started by: Johanni
2 Replies
4. Shell Programming and Scripting
execute the attached script as,
bash -x INFA_MAP_GEN_XML.sh "/export/home/e120945/INFORMATICA_MAPPING_GENERATOR/SOURCE" "INFA_TEMPLATE.csv" "/export/home/e120945/INFORMATICA_MAPPING_GENERATOR/TARGET" "UNIX" "/export/home/e120945/INFORMATICA_MAPPING_GENERATOR/SETUP"... (5 Replies)
Discussion started by: 120945
5 Replies
5. Shell Programming and Scripting
I would create a bash script than parse like this:
test.sh -p (protocol) -i (address) -d (directory)
I need retrive the value after -p for example...
understand???
I hope...
thanks (6 Replies)
Discussion started by: ionral
6 Replies
6. Shell Programming and Scripting
Hi, I have written a script that allows me to repetitively play a music file $N times, which is specified through user input. However, if I want to exit the script before it has finished looping $N times, if I use CTRL+c, I have to CTRL+c however many times are left in order to complete the loop.... (9 Replies)
Discussion started by: hilltop_yodeler
9 Replies
7. Shell Programming and Scripting
Hi Folks,
I have the below feed file named abc1.txt in which you can see there is a title and below is the respective values in the rows and it is completely pipe delimited file ,.
... (3 Replies)
Discussion started by: punpun66
3 Replies
8. Shell Programming and Scripting
I have the following while loop that I put in a script, demo.sh:
while read rna; do
aawork=$(echo "${rna}" | sed -n -e 's/\(...\)\1 /gp' | sed -f rna.sed)
echo "$aawork" | sed 's/ //g'
echo "$aawork" | tr ' ' '\012' | sort | sed '/^$/d' | uniq -c | sed 's/*\(*\) \(.*\)/\2: \... (3 Replies)
Discussion started by: faizlo
3 Replies
9. Shell Programming and Scripting
hello guys
i have bash script to open my routers with username and password
i made script but i have problem this script can/t read password from file
#!/bin/bash
router_file="ips"
passwd="password.txt"
for router in cat ;$router_file do
for pass in cat ;$passwd; do
res=$(curl -m 1 ... (7 Replies)
Discussion started by: manhoud
7 Replies
10. Shell Programming and Scripting
Hi,
when I try to redirect input and the command is described as a string within an array redirection does not work. why?
#!/bin/bash
dir=("tail < ./hello.txt")
tail < ./hello.txt #works
${dir} #does not work (2 Replies)
Discussion started by: heinzel
2 Replies
CMPCI(4) BSD Kernel Interfaces Manual CMPCI(4)
NAME
cmpci -- C-Media CMI8x38 audio device driver
SYNOPSIS
cmpci* at pci? dev ? function ?
audio* at audiobus?
mpu* at cmpci?
opl* at cmpci? flags 1
DESCRIPTION
The cmpci device driver supports C-Media CMI8x38 based sound cards.
The device has SPDIF input/output interfaces, 16bit CODEC with analog mixer, OPL3 FM Synthesizer, and MPU401 compatible MIDI I/O port inter-
face.
MIXER DEVICE
The mixer device of cmpci driver can be accessed via mixerctl(1) command. The complex structure is analyzed as follows.
SPDIF in ----------------------
#1(coax)->|spdin1 | R -----------------------
#2(opt)-->|spdin2 spdif.input |--*->--|spdin spdif.output |--> SPDIF
-->|spdout | | -->|playback | output
| ---------------------- | | -----------------------
--------------------<------+-*
---------<-------------------+-+----------------------------------
| ------------------------ | | ----------------------- |
-->|legacy spdif.output. |--+-*-->|spdout | |
-->|wave playback | ----->|spdin spdif.monitor |---- |
| ------------------------ NC-|off | | |
---------<-- spdif ----------------------- | |
-------+------- dac ------------ ----------------- v |
wave -->|playback.mode|---->|inputs.dac|-*->|inputs.dac.mute|->----- |
playback --------------- ------------ R ----------------- | + | |
----------------- --------------------- |mix| |
FM synthesizer -->|inputs.fmsynth |--*->|inputs.fmsynth.mute|-->----- |
----------------- R --------------------- *->--
CD ---------------------- --------------------------- v
LINE-IN ->|inputs.{cd,line,aux}|-*>|inputs.{cd,line,aux}.mute|->-----
AUX ---------------------- R --------------------------- | |
------------------ | |
PC-SPK -->| inputs.speaker |----------------------------------->| + |
------------------ | |
------------------- ------------ ----------------- |mix|
MIC --*-->|inputs.mic.preamp|->|inputs.mic|->|inputs.mic.mute|->| |
| ------------------- ------------ ----------------- -----
| ------------ ----------------- |
--->|record.mic|-->| | v
------------ | record.source |-->to -----------
*R-->| (select, mix) | recording |outputs.*|-->
----------------- ----------- SPK
(front)
Note the 2nd SPDIF input exists only on CMI8738/PCI-6ch versions.
MIXER EXAMPLES
Here are examples about wave playback and SPDIF input/output ports.
Playback to speaker, SPDIF input to SPDIF output
mixerctl -w playback.mode=dac spdif.output=spdin spdif.monitor=off
Playback to SPDIF output, SPDIF input to speaker
mixerctl -w playback.mode=spdif spdif.output=playback spdif.output.playback=wave spdif.monitor=spdin
SPDIF input to both SPDIF output and speaker
mixerctl -w spdif.output=spdin spdif.monitor=spdin
Playback to both SPDIF output and speaker
mixerctl -w playback.mode=spdif spdif.output=playback spdif.output.playback=wave spdif.monitor=spdout
Mix playback and SPDIF input to speaker
mixerctl -w playback.mode=dac spdif.monitor=spdin
SEE ALSO
mixerctl(1), audio(4), midi(4), mpu(4), opl(4), pci(4)
HISTORY
The cmpci device driver appeared in NetBSD 1.5.
BUGS
4ch/6ch playback is not yet available. Joystick port is not supported.
spdif.output.playback=legacy does not seem to work properly.
BSD
June 22, 2005 BSD