However When I run the script with input redirection using
operator, it simply reverts back to me with this
my answers file looks like this
Question is: When taking input from file, the interactive questions/answer is not shown and I don't see what is going on.
This is just simulation -- actual script takes a lot longer list of options
how do I use a file (comma seperated) as an input for a script in bin/sh?
e.g.
I have a script that :
Input1=$1
Input2=$2
Input3=$3
Input4=$4
echo "$Input1, $Input2, $Input3,$Input4" (or some other function)
If I have a .csv file which lists many rows of input:
joe,5,john,10... (1 Reply)
#!/bin/sh
rpt="/export/home/legato/rpt_offsite"/test_eject.tape
cat <$rpt
while read line
do
echo $line
perform routine
done
I am trying to read the contents of this file line by line and perform a routine for each line read.
The file contents are numbers..
What is wrong with my... (1 Reply)
Hi,
I have an expect script that logs into a host (via ssh) requests the hostid then exits... I am happy with that.
However how can I run the same script in a kind of 'while read line' and enter lots of hosts? My knowledge is still very limited (as you will soon see) so any other ideas would... (2 Replies)
Hi all
As quite newbie in shell scripting i need your help.
The case: two files with question mark delimeter:
file1.txt:
A; B; D; E;
file2.txt:
a,antonis,red; b,maria,green; c,george,blue; d,jack,red; e,Helen,yellow; k,konstantin,black;
I need an effiecient way of parsing while it... (2 Replies)
All,
I am trying to figure out a script to run in windows that will allow me to match on First column in file1 to 8th Column in File2 then
Insert file1 column2 to file2 column4 then create a new file.
File1:
12345 Sam
12346 Bob
12347 Bill
File2:... (1 Reply)
Hi All,
I am hoping someone can help me with some scripting I need to complete using AWK.
I'm trying to process multiple fixed files to generate one concatenated fixed file in a standard format.
The Input file is:-
aaaa bbbbb ccccc 1 xxxx aaa bbb
aaaa bbbbb ccccc 2 abcd aaa CCC... (9 Replies)
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)
Hello,
I'm trying to figure out how best to approach this script, and I have very little experience, so I could use all the help I can get. :wall:
I regularly need to delete files from many directories.
A file with the same name may exist any number of times in different subdirectories.... (3 Replies)
I have four files:
test
test2
test3
test4
I have this simple script:
#!/bin/bash
ls $1
Why does ./the_script.sh test* only list the first file, when a normal ls test* would list all four? What do I need to change in the script to be able to use wildcard? (12 Replies)
I know I can obtain the file names in a folder by doing the following.
ls | awk '{t=$1; print t}'
Rather than print t, I'd like to take the file name as an input to a script like
bash-3.00$ more test.sh
echo "this is a test"
ls -l $1
When I run the script, I put "./test.sh a.out" and... (5 Replies)
Discussion started by: learnix
5 Replies
LEARN ABOUT LINUX
irsend
IRSEND(1) User Commands IRSEND(1)NAME
irsend - basic LIRC program to send infra-red commands
SYNOPSIS
irsend [options] DIRECTIVE REMOTE CODE [CODE...]
DESCRIPTION
Asks the lircd daemon to send one or more CIR (Consumer Infra-Red) commands. This is intended for remote control of electronic devices such
as TV boxes, HiFi sets, etc.
DIRECTIVE can be:
SEND_ONCE - send CODE [CODE ...] once
SEND_START - start repeating CODE
SEND_STOP - stop repeating CODE
LIST - list configured remote items
SET_TRANSMITTERS - set transmitters NUM [NUM ...]
SIMULATE - simulate IR event
REMOTE is the name of a remote, as described in the lircd configuration file.
CODE is the name of a remote control key of REMOTE, as it appears in the lircd configuration file.
NUM is the transmitter number of the hardware device.
For the LIST DIRECTIVE, REMOTE and/or CODE can be empty:
LIST "" "" - list all configured remote names
LIST REMOTE "" - list all codes of REMOTE
LIST REMOTE CODE - list only CODE of REMOTE
The SIMULATE command only works if it has been explicitly enabled in lircd.
-h --help
display usage summary
-v --version
display version
-d --device
use given lircd socket [/var/run/lirc/lircd]
-a --address=host[:port]
connect to lircd at this address
-# --count=n
send command n times
EXAMPLES
irsend LIST DenonTuner ""
irsend SEND_ONCE DenonTuner PROG-SCAN
irsend SEND_ONCE OnkyoAmpli VOL-UP VOL-UP VOL-UP VOL-UP
irsend SEND_START OnkyoAmpli VOL-DOWN ; sleep 3
irsend SEND_STOP OnkyoAmpli VOL-DOWN
irsend SET_TRANSMITTERS 1
irsend SET_TRANSMITTERS 1 3 4
irsend SIMULATE "0000000000000476 00 OK TECHNISAT_ST3004S"
FILES
/etc/lirc/lircd.conf
Default lircd configuration file. It should contain all the remotes, their infra-red codes and the corresponding timing and wave-
form details.
DIAGNOSTICS
If lircd is not running (or /var/run/lirc/lircd lacks write permissions) irsend aborts with the following diagnostics:
"irsend: could not connect to socket"
"irsend: Connection refused" (or "Permission denied").
SEE ALSO
The documentation for lirc is maintained as html pages. They are located under html/ in the documentation directory.
lircd(8), mode2(1), smode2(1), xmode2(1), irrecord(1), irw(1), http://www.lirc.org.
irsend 0.9.0-pre1 October 2010 IRSEND(1)