Sponsored Content
Top Forums Shell Programming and Scripting "if" statement based off "grep" Post 302651123 by balajesuri on Tuesday 5th of June 2012 02:46:39 AM
Old 06-05-2012
Quote:
Originally Posted by Amzerik
if [ $Dating - eq 0 ] ; then
From jim_mcnamara's post, it's [ $? -eq 0 ] not [ $Dating -eq 0 ]

You don't actually need "Dating" variables (pun intended Smilie)
 

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

"Join" or "Merge" more than 2 files into single output based on common key (column)

Hi All, I have working (Perl) code to combine 2 input files into a single output file using the join function that works to a point, but has the following limitations: 1. I am restrained to 2 input files only. 2. Only the "matched" fields are written out to the "matched" output file and... (1 Reply)
Discussion started by: Katabatic
1 Replies

3. Shell Programming and Scripting

ps -ef | grep "string1" "string2" " "string3"

Hi all, can any one suggest me the script to grep multiple strings from ps -ef pls correct the below script . its not working/ i want to print OK if all the below process are running in my solaris system. else i want to print NOT OK. bash-3.00$ ps -ef | grep blu lscpusr 48 42 ... (11 Replies)
Discussion started by: steve2216
11 Replies

4. 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

5. 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

6. Shell Programming and Scripting

grep with "[" and "]" and "dot" within the search string

Hello. Following recommendations for one of my threads, this is working perfectly : #!/bin/bash CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" ) Now I need a grep success for some thing like : #!/bin/bash CNT=$( grep -c -e "some text_1... (4 Replies)
Discussion started by: jcdole
4 Replies

7. 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

8. 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

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
Dist::Zilla::Tutorial(3pm)				User Contributed Perl Documentation				Dist::Zilla::Tutorial(3pm)

NAME
Dist::Zilla::Tutorial - how to use this "Dist::Zilla" thing VERSION
version 4.300020 SYNOPSIS
BEFORE YOU GET STARTED: Maybe you should be looking at the web-based tutorial instead. It's more complete. <http://dzil.org/tutorial/start.html> Dist::Zilla builds distributions to be uploaded to the CPAN. That means that the first thing you'll need is some code. Once you've got that, you'll need to configure Dist::Zilla. Here's a simple dist.ini: name = Carbon-Dating version = 0.003 author = Alan Smithee <asmithee@example.org> license = Perl_5 copyright_holder = Alan Smithee [@Basic] [Prereq] App::Cmd = 0.013 Number::Nary = 0 Sub::Exporter = 0.981 The topmost section configures Dist::Zilla itself. Here are some of the entries it expects: name - (required) the name of the dist being built version - (required) the version of the dist abstract - (required) a short description of the dist author - (optional) the dist author (you may have multiple entries for this) license - (required) the dist license; must be a Software::License::* name copyright_holder - (required) the entity holding copyright on the dist Some of the required values above may actually be provided by means other than the top-level section of the config. For example, VersionProvider plugins can set the version, and a line like this in the "main module" of the dist will set the abstract: # ABSTRACT: a totally cool way to do totally great stuff The main modules is the module that shares the same name as the dist, in general. Named sections load plugins, with the following rules: If a section name begins with an equals sign ("="), the rest of the section name is left intact and not expanded. If the section name begins with an at sign ("@"), it is prepended with "Dist::Zilla::PluginBundle::". Otherwise, it is prepended with "Dist::Zilla::Plugin::". The values inside a section are given as configuration to the plugin. Consult each plugin's documentation for more information. The "Basic" bundle, seen above, builds a fairly normal distribution. It rewrites tests from ./xt, adds some information to POD, and builds a Makefile.PL. For more information, you can look at the docs for @Basic and see the plugins it includes. BUILDING YOUR DIST
Maybe we're getting ahead of ourselves, here. Configuring a bunch of plugins won't do you a lot of good unless you know how to use them to build your dist. Dist::Zilla ships with a command called dzil that will get installed by default. While it can be extended to offer more commands, there are two really useful ones: $ dzil build The "build" command will build the distribution. Say you're using the configuration in the SYNOPSIS above. You'll end up with a file called Carbon-Dating-0.004.tar.gz. As long as you've done everything right, it will be suitable for uploading to the CPAN. Of course, you should really test it out first. You can test the dist you'd be building by running another dzil command: $ dzil test This will build a new copy of your distribution and run its tests, so you'll know whether the dist that "build" would build is worth releasing! HOW BUILDS GET BUILT
This is really more of a sketchy overview than a spec. First, all the plugins that perform the BeforeBuild perform their "before_build" tasks. The build root (where the dist is being built) is made. The FileGatherers gather and inject files into the distribution, then the FilePruners remove some of them. All the FileMungers get a chance to muck about with each file, possibly changing its name, content, or installability. Now that the distribution is basically set up, it needs an install tool, like a Makefile.PL. All the InstallTool-performing plugins are used to do whatever is needed to make the dist installable. Everything is just about done. The files are all written out to disk and the AfterBuild plugins do their thing. RELEASING YOUR DIST
By running "dzil release", you'll can test your distribution, build a tarball of it, and upload it to the CPAN. Plugins are able to do things like check your version control system to make sure you're releasing a new version and that you tag the version you've just uploaded. It can also update your Changelog file, too, making sure that you don't need to know what your next version number will be before releasing. The final CPAN release process is implemented by the UploadToCPAN plugin. However you can replace it by your own to match your own (company?) process. SEE ALSO
dzil AUTHOR
Ricardo SIGNES <rjbs@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Ricardo SIGNES. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-21 Dist::Zilla::Tutorial(3pm)
All times are GMT -4. The time now is 01:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy