Sponsored Content
Full Discussion: Program based on hostname
Top Forums Shell Programming and Scripting Program based on hostname Post 302844071 by darling on Friday 16th of August 2013 09:37:17 AM
Old 08-16-2013
I am trying from my end and then only asking for your help. That is why i am posting replies late.

throwing below error
Code:
./jj.sh[9]: "${QM:${#QM}-1:1}": bad substitution

till below code it is fine

Code:
#!/bin/ksh
QM=$1
echo "enter QM"
read QM
hostname=$2
echo "enter hostname"
read hostname
case "$QM" in
    *1) NEED=51431;;
    *2) NEED=51432;;
    *3) NEED=51433;;
    *4) NEED=51434;;
    ?) NEED=-1;;
  esac

here how to store that value of 51431 or smnthg?

then need to get IP address from hostname by using hostname -i

and keep in below command

Code:
echo $1 >&2 \ export MQSERVER=SYSTEM.DEF.SVRCONN/TCP/'$3($4)' \ ./qload -ISYSTEM.DEAD.LETTER.QUEUE -lmqic32 -m$1 >&2

 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

dos based ssh/telnet login program

I want to find a program that can run in DOS, login to a ssh/telnet server, then run a specifed command to do a daily jobs, can anyone tell me is there any application i can find in the internet? (2 Replies)
Discussion started by: zp523444
2 Replies

2. UNIX for Dummies Questions & Answers

Solaris - unknown hostname - how can I change hostname?

Hello, I am new to Solaris. I am using stand alone Solaris 10.0 for test/study purpose and connecting to internet via an ADSL modem which has DHCP server. My Solaris is working on VMWare within winXP. My WinXP and Solaris connects to internet by the same ADSL modem via its DHCP at the same... (1 Reply)
Discussion started by: XNOR
1 Replies

3. UNIX for Dummies Questions & Answers

proceed through a menu-based program with a script?

I am trying to figure out a way to proceed through a menu-based program in UNIX with just one command to execute several steps. Is this possible? From the command prompt I would normally type the name of the program, 'disk_analysis' to start the program and bring up its menu. I would then... (4 Replies)
Discussion started by: nichola$
4 Replies

4. UNIX for Dummies Questions & Answers

Problem in GUI based program on Sun Solaris

Hello! I am trying to run a program which has used Xlib for its graphical user interface on Solaris through Common Desktop Environment(CDE). All I get is my three required widows open but all blank.They suppose to show some symbols, pictures ad buttons.In the command terminal the following... (1 Reply)
Discussion started by: asif92
1 Replies

5. Emergency UNIX and Linux Support

HP UX - ILO Console hostname different than Machine Hostname...

Hi All, So we added a new HP-UX 11.31 machine. Copied OS via Ignite-UX (DVD)over from this machine called machine_a. It was supposed to be named machine_c. And it is when you log in...however when I'm in the ILO console before logging in, it says: It should say: What gives? And how do... (4 Replies)
Discussion started by: zixzix01
4 Replies

6. Programming

C program - convert values based on the position

Hey! I'm new to C. I need to covert certain values using C. please see the below. I have figured out the logic to do it. Please provide some hints to do this with C Logic: If first position of POS = 0, shift POS to the left one byte. If third position of POS = 0, move spaces to third... (1 Reply)
Discussion started by: rocker_me2002
1 Replies

7. Shell Programming and Scripting

Sleep timer based on hostname

Dear all I have a bunch of hosts which I need to run a common script. I need a sleep timee which will delay the execution based on the hostname. Usually the hostname of the servers are host01, host02 .. host16 with which I cam up with this - #!/bin/bash sleeptimer=$(( $(hostname -s|tr -cd... (3 Replies)
Discussion started by: deunan
3 Replies

8. UNIX for Advanced & Expert Users

Hostname -f hostname: Unknown host

deleted (0 Replies)
Discussion started by: hce
0 Replies
IRSEND(1)								FSF								 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.8.7pre1 May 2010 IRSEND(1)
All times are GMT -4. The time now is 04:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy