Sponsored Content
Top Forums Shell Programming and Scripting What "-a" operator means in "if" statement Post 302501050 by methyl on Wednesday 2nd of March 2011 10:30:54 AM
Old 03-02-2011
It just means "if the file exists". See the Conditional Expressions section of the "man" page for your Shell.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

cannot properly employ "or" operator in an if statement (bash)

Hi, I have a variable, $sername, and I would like to display this variable only if it *does not* contain either of these two tags: *DTI*FA* or *DIFF*FA*. I think the syntax for my 'or' operator is off. The variable $sername is continuously changing in an outer loop (not shown), but at the... (4 Replies)
Discussion started by: goodbenito
4 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

5. Solaris

The slices "usr", "opt", "tmp" disappeared!!! Help please.

The system don't boot. on the screen appears following: press enter to maintenance (or type CTRL-D to continue)...I checked with format command. ... the slices "0-root","1-swap","2-backup" exist. ...the slises "3-var","6-usr" -unassigned. :( (16 Replies)
Discussion started by: wolfgang
16 Replies

6. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

7. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

8. UNIX for Beginners Questions & Answers

What does "force devmap reload" as in "multipath -r" means for my system and stability of my system?

Cannot present unpresented disks back again. On a test server tried this as a solution "multipath -r" and it worked. Too worried to try it in production before I know all the information. Any info would be appreciated! Also some links to the documentation on this specific issue could help a... (1 Reply)
Discussion started by: jsteppe
1 Replies

9. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
Shell::Perl::Dumper(3pm)				User Contributed Perl Documentation				  Shell::Perl::Dumper(3pm)

NAME
Shell::Perl::Dumper - Dumpers for Shell::Perl SYNOPSYS
use Shell::Perl::Dumper; $dumper = Shell::Perl::Dumper::Plain->new; print $dumper->dump_scalar($scalar); print $dumper->dump_list(@list); DESCRIPTION
In "pirl", the result of the evaluation is transformed into a string to be printed. As this result may be a pretty complex data structure, the shell provides a hook for you to pretty-print these answers just the way you want. By default, "pirl" will try to convert the results via "Data::Dump". That means the output will be Perl code that may be run to get the data structure again. Alternatively, the shell may use "Data::Dumper" or "Data::Dump::Streamer" with almost the same result with respect to the representation as Perl code. (But the output of the modules differ enough for sufficiently complex data.) Other options are to set the output to produce YAML or a plain simple-minded solution which basically turns the result to string via simple interpolation. All of these are implemented via dumper objects. Dumpers are meant to be used like that: $dumper = Some::Dumper::Class->new; # build a dumper $s = $dumper->dump_scalar($scalar); # from scalar to string $s = $dumper->dump_list(@list); # from list to string METHODS The following methods compose the expected API of a dumper, as used by Shell::Perl. new $dumper = $class->new(@args); Constructs a dumper. dump_scalar $s = $dumper->dump_scalar($scalar); Turns a scalar into a string representation. dump_list $s = $dumper->dump_list(@list); Turns a list into a string representation. is_available $ok = $class->is_available This is an optional class method. If it exists, it means that the class has external dependencies (like "Shell::Perl::Data::Dump" depends on "Data::Dump") and whether these may be loaded when needed. If they can, this method returns true. Otherwise, returning false means that a dumper instance of this class probably cannot work. This is typically because the dependency is not installed or cannot be loaded due to an installation problem. This is the algorithm used by Shell::Perl XXX XXX XXX 1. THE STANDARD DUMPERS
Shell::Perl provides four standard dumpers: * Shell::Perl::Data::Dump * Shell::Perl::Data::Dumper * Shell::Perl::Data::Dump::Streamer * Shell::Perl::Dumper::YAML * Shell::Perl::Dumper::Plain which corresponds to the four options of the command " :set out ": "D", "DD", "DDS", "Y", and "P" respectively. Data::Dump The package "Shell::Perl::Data::Dump" implements a dumper which uses Data::Dump to turn Perl variables into a string representation. It is used like this: use Shell::Perl::Dumper; if (!Shell::Perl::Data::Dump->is_available) { die "the dumper cannot be loaded correctly" } $dumper = Shell::Perl::Data::Dump->new; print $dumper->dump_scalar($scalar); print $dumper->dump_list(@list); Examples of its output: pirl > :set out D pirl > { a => 3 } #scalar { a => 3 } pirl > (1, 2, "a") #list (1, 2, "a") Data::Dumper The package "Shell::Perl::Data::Dumper" implements a dumper which uses Data::Dumper to turn Perl variables into a string representation. It is used like this: use Shell::Perl::Dumper; if (!Shell::Perl::Data::Dumper->is_available) { die "the dumper cannot be loaded correctly" } $dumper = Shell::Perl::Data::Dumper->new; print $dumper->dump_scalar($scalar); print $dumper->dump_list(@list); Examples of its output: pirl > :set out DD pirl > { a => 3 } #scalar @var = ( { 'a' => 3 } ); pirl > (1, 2, "a") #list @var = ( 1, 2, 'a' ); YAML The package "Shell::Perl::Dumper::YAML" implements a dumper which uses YAML::Syck or YAML to turn Perl variables into a string representation. It is used like this: use Shell::Perl::Dumper; if (!Shell::Perl::Dumper::YAML->is_available) { die "the dumper cannot be loaded correctly" } $dumper = Shell::Perl::Dumper::YAML->new; print $dumper->dump_scalar($scalar); print $dumper->dump_list(@list); Examples of its output: pirl > :set out Y pirl @> { a => 3 } #scalar --- a: 3 pirl @> (1, 2, "a") #list --- 1 --- 2 --- a When loading, "YAML::Syck" is preferred to "YAML". If it is not avaiable, the "YAML" module is the second option. Data::Dump::Streamer The documentation is yet to be written. Plain Dumper The package "Shell::Perl::Dumper::Plain" implements a dumper which uses string interpolation to turn Perl variables into strings. It is used like this: use Shell::Perl::Dumper; $dumper = Shell::Perl::Dumper::Plain->new; print $dumper->dump_scalar($scalar); print $dumper->dump_list(@list); Examples of its output: pirl > :set out P pirl > { a => 3 } #scalar HASH(0x1094d2c0) pirl > (1, 2, "a") #list 1 2 a SEE ALSO
Shell::Perl BUGS
Please report bugs via CPAN RT <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Shell-Perl> or <mailto://bugs-Shell-Perl@rt.cpan.org>. AUTHORS
Adriano R. Ferreira, <ferreira@cpan.org> Caio Marcelo, <cmarcelo@gmail.com> COPYRIGHT AND LICENSE
Copyright (C) 2007aXX2011 by Adriano R. Ferreira This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2011-03-10 Shell::Perl::Dumper(3pm)
All times are GMT -4. The time now is 09:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy