Sponsored Content
Full Discussion: Perl : meaning of ||= symbol
Top Forums Shell Programming and Scripting Perl : meaning of ||= symbol Post 302700849 by alister on Friday 14th of September 2012 09:58:09 AM
Old 09-14-2012
Short version:
x ||= y means that if x is false, set it to y.

Long version:
||= is an assignment operator. x ||= y is the same thing as x = x || y. || is the logical-OR operation. If the first operand (x) is a true value, it is returned. If it is false, the second operand (y) is returned. This is the typical logical-OR shortcircuiting behavior seen in C and many other languages.

Regards,
Alister

---------- Post updated at 09:58 AM ---------- Previous update was at 09:56 AM ----------

Quote:
Originally Posted by giridhar276
---------- Post updated at 08:17 AM ---------- Previous update was at 07:16 AM ----------
Don't bump your posts unless there is new, relevant information. Or at least wait a day. If it's an urgent matter, there's an Emergency forum you can use.

Regards,
Alister
 

10 More Discussions You Might Find Interesting

1. AIX

meaning of ${0%${0##*/}}

. ${0%${0##*/}}Script_Name if i issue this command, it is executing the script. can any one tell what is the meaning of ${0%${0##*/}} (7 Replies)
Discussion started by: nyelavarthy
7 Replies

2. UNIX for Dummies Questions & Answers

what the meaning of #*

can some one please tell the meaning of the second statement i.e n=${m#*=} i couldnt get the meaning of the #*= 1.) m="mohit=/c/main/issue" echo $m result ----------- mohit=/c/main/issue 2.) n=${m#*=} echo $n RESULT ------- /c/main/issue (1 Reply)
Discussion started by: narang.mohit
1 Replies

3. Solaris

/usr/lib/passwdutil.so.1: symbol __nsl_fgetspent_r: referenced symbol not found

deleteing post (0 Replies)
Discussion started by: dshakey
0 Replies

4. Shell Programming and Scripting

meaning of !*

can someone please tell what !* means in shell syntax. Regards, (3 Replies)
Discussion started by: busyboy
3 Replies

5. UNIX for Dummies Questions & Answers

meaning of <<!

Hi all, I wanna know the meaning of the last word "<<! " sudo su - user <<! please help on this !!!! (1 Reply)
Discussion started by: sudharson
1 Replies

6. Shell Programming and Scripting

Replace trailing whitespaces with pipe symbol using perl

I want to replace the whitespace with Pipe symbol to do a multiple pattern matching for the whole text "mysqld failed start" and same as for other text messages Below are the messages stored in a file seperate by whitespace mysqld failed start nfsd mount failed rpcbind failed to start for... (6 Replies)
Discussion started by: kar_333
6 Replies

7. Shell Programming and Scripting

What is the meaning of the following Perl Code?

Hi All Can any one please help me to understand the below Perl Code package Win32::File; # # File.pm # Written by Douglas_Lankshear@ActiveWare.com # # subsequent hacks: # Gurusamy Sarathy # $VERSION = '0.06'; require Exporter; require DynaLoader; @ISA= qw( Exporter... (1 Reply)
Discussion started by: adisky123
1 Replies

8. Shell Programming and Scripting

Perl : Global symbol requires explicit package name Error while executing

I have executed the below perl script for copying the file from one server to another server using scp. #!/usr/bin/perl -w use Net::SCP::Expect; use strict; $server= "x.x.x.x"; my $source = "/mypath/mypath"; my $destination = "/home/"; print "Login...Starting scp..."; $user="admin";... (1 Reply)
Discussion started by: scriptscript
1 Replies

9. Shell Programming and Scripting

Meaning

Please let me know the meaning for the below statements in shell scripting. 1) exit -99 -------------------------------- 2) set prgdir = `pwd` set runFlag = runFlag:FALSE ------------------------------------- 3) if (-f $prgdir/maillst.eml) then set distEmail = `cat $prgdir/maillst.eml`... (1 Reply)
Discussion started by: lg123
1 Replies

10. Shell Programming and Scripting

Meaning of $1^

Hello everyone, I'm looking for the meaning of this expression, as I don't understand it quite clearly : $1^ What do you think it could be? I thought either: - match lines starting with argument 1 but it should be ^$1 - turn line around : word becomes drow Thanks in advance for your... (4 Replies)
Discussion started by: bibelo
4 Replies
PSNUP(1)                                                      General Commands Manual                                                     PSNUP(1)

NAME
psnup - multiple pages per sheet SYNOPSIS
psnup [ -wwidth ] [ -hheight ] [ -ppaper ] [ -Wwidth ] [ -Hheight ] [ -Ppaper ] [ -l ] [ -r ] [ -f ] [ -c ] [ -mmargin ] [ -bborder ] [ -dlwidth ] [ -sscale ] [ -nup ] [ -q ] [ infile [ outfile ] ] DESCRIPTION
Psnup puts multiple logical pages onto each physical sheet of paper. The input PostScript file should follow the Adobe Document Structur- ing Conventions. The -w option gives the paper width, and the -h option gives the paper height, normally specified in cm or in to convert PostScript's points (1/72 of an inch) to centimeters or inches. The -p option can be used as an alternative, to set the paper size to a0, a1, a2, a3, a4, a5, b5, letter, legal, tabloid, statement, executive, folio, quarto or 10x14. The default paper size is normally a4, but on a Debian system, /etc/papersize is consulted. The -W, -H, and -P options set the input paper size, if it is different from the output size. This makes it easy to impose pages of one size on a different size of paper. The -l option should be used for pages which are in landscape orientation (rotated 90 degrees anticlockwise). The -r option should be used for pages which are in seascape orientation (rotated 90 degrees clockwise), and the -f option should be used for pages which have the width and height interchanged, but are not rotated. Psnup normally uses `row-major' layout, where adjacent pages are placed in rows across the paper. The -c option changes the order to `col- umn-major', where successive pages are placed in columns down the paper. A margin to leave around the whole page can be specified with the -m option. This is useful for sheets of `thumbnail' pages, because the normal page margins are reduced by putting multiple pages on a single sheet. The -b option is used to specify an additional margin around each page on a sheet. The -d option draws a line around the border of each page, of the specified width. If the lwidth parameter is omitted, a default linewidth of 1 point is assumed. The linewidth is relative to the original page dimensions, i.e. it is scaled down with the rest of the page. The scale chosen by psnup can be overridden with the -s option. This is useful to merge pages which are already reduced. The -nup option selects the number of logical pages to put on each sheet of paper. This can be any whole number; psnup tries to optimise the layout so that the minimum amount of space is wasted. If psnup cannot find a layout within its tolerance limit, it will abort with an error message. The alternative form i nup can also be used, for compatibility with other n-up programs. Psnup normally prints the page numbers of the pages re-arranged; the -q option suppresses this. EXAMPLES
The potential use of this utility is varied but one particular use is in conjunction with psbook(1). For example, using groff to create a PostScript document and lpr as the UNIX print spooler a typical command line might look like this: groff -Tps -ms file | psbook | psnup -2 | lpr Where file is a 4 page document this command will result in a two page document printing two pages of file per page and rearranges the page order to match the input pages 4 and 1 on the first output page and pages 2 then 3 of the input document on the second output page. AUTHOR
Copyright (C) Angus J. C. Duggan 1991-1995 SEE ALSO
psbook(1), psselect(1), pstops(1), epsffit(1), psnup(1), psresize(1), psmerge(1), fixscribeps(1), getafm(1), fixdlsrps(1), fixfmps(1), fix- psditps(1), fixpspps(1), fixtpps(1), fixwfwps(1), fixwpps(1), fixwwps(1), extractres(1), includeres(1), showchar(1) TRADEMARKS
PostScript is a trademark of Adobe Systems Incorporated. BUGS
Psnup does not accept all DSC comments. PSUtils Release 1 Patchlevel 17 PSNUP(1)
All times are GMT -4. The time now is 11:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy