Sponsored Content
Top Forums Shell Programming and Scripting Significance of ':-' while accessing a variable Post 302758541 by zulfi123786 on Sunday 20th of January 2013 04:54:02 AM
Old 01-20-2013
Significance of ':-' while accessing a variable

Hi

I was trying to understand what ':-' means when used with variables

Code:
 
echo ${x:-10}
 
if [ "${OSH_compileFlag:-}" = "1" ]

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Accessing invidual characters in a variable name

hi, How do i access individual characters in a string variable value . say i have var=20060731. How do i retrieve 2,0,0,6 etc chars separately. Is there any Field separator in cut or awk to achieve the same? Regards, Suman (2 Replies)
Discussion started by: suman_jakkula
2 Replies

2. UNIX for Dummies Questions & Answers

accessing shell script variable in file

Hi, I have a shell script in which there is a file conn_$temp where $temp has the pid of the shell script. in this shell script i have an embedded awk script that must read the file while ((getline < "conn_$temp") > 0) However due to the "$temp" in the file name, the awk script is... (6 Replies)
Discussion started by: HIMANI
6 Replies

3. UNIX for Dummies Questions & Answers

Accessing Global Env Variable

Greetings: I need to remove 'RUBYOPT' env variable to install MacRuby. I see it via $env (tchrc). I checked my (local) .tcshrc, .login, .profile files: not defined there. Apparently, it's not set locally. I know this RUBYOPT is global, since I can see it in another account on my... (4 Replies)
Discussion started by: UncleRic
4 Replies

4. Shell Programming and Scripting

Accessing a variable from another script

Hi, Can anyone assist me on how to access a variable in a shell script from another script. for ex, Script-1 ------- #! /bin/sh c=10 Where as, i would like to access the velue of variable c in another script 'Script-2'. Thankyou to all in advance !! :b: :b: (2 Replies)
Discussion started by: little_wonder
2 Replies

5. Shell Programming and Scripting

Accessing variable from awk program in shell

Hi, I want to access a variable outside the awk program. My program is as below:- I can not access the exact value of k (See the last line of the program). #!/usr/bin/sh j=10 k=1 #k is declared outside awk awk ' BEGIN { i=1; j1="'"$j"'" printf("\n ## Value of j1 is %d ##", j1); ... (2 Replies)
Discussion started by: shouvik.mitra
2 Replies

6. Shell Programming and Scripting

Accessing the variable from pl sql bolck

I hve a PL SQL block in unix where i define a variable "var_px_cat" and use it for taking count SELECT COUNT(*) INTO var_px_cat FROM A WHERE B = '$CATEGORIE_ID'; Now how do I access the variable "var_px_cat" in unix after exiting from pl sql block. (3 Replies)
Discussion started by: theeights
3 Replies

7. Shell Programming and Scripting

accessing a variable or array of one script in another

hi all, i've a requirement like this. i want to access the contents of an array declared in one script,which is a bash script, to a second script which is a perl script. actually i want a sort of global variable which can be accessed in other script like environmen variables and also i can... (3 Replies)
Discussion started by: tprayush
3 Replies

8. Shell Programming and Scripting

Accessing a variable from another file

HI all, How can i access a variable that is defined in another file as: $$Name= "abhinav; in my script. The catch is that it has 2 $s behind it... Thnaks ---------- Post updated at 10:36 AM ---------- Previous update was at 10:29 AM ---------- the file from which i have to... (0 Replies)
Discussion started by: abhinav192
0 Replies

9. Shell Programming and Scripting

Accessing local variable

Hi, Would like to know the purpose and accessing of local variable as in below code snippet: a=123 ( a=321; ) echo "a = $a" #This will print 123 How to access local a variable which is assigned with value 321 ?. .. (3 Replies)
Discussion started by: IND123
3 Replies

10. Shell Programming and Scripting

accessing variable from while loop

Hi all, Here is an outline of the problem: #variable declared at start of script x=0; #a function that increments x by 1 every 10 seconds incrementX(){ increments x every 10 seconds; } #i want this to output the value of x every second. The problem is that x is always reported... (3 Replies)
Discussion started by: free2rhyme2k
3 Replies
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)
All times are GMT -4. The time now is 06:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy