Sponsored Content
Top Forums Shell Programming and Scripting SOLVED: reading config file in a perl script Post 302447326 by konsolebox on Sunday 22nd of August 2010 01:16:58 PM
Old 08-22-2010
I don't really get what you're after but here's some hint for bash:
Code:
#!/bin/bash

CONFIGFILE=<path to file>
LOGFILE=<path to log file>

read URL < "$CONFIGFILE"

echo "Fetching $URL..."
wget -o "$LOGFILE" "$URL"

# examine based from return value

case "$?" in
0)
    ....
    ;;
1)
    echo "WARN"
    ;;
2)
    echo "ERROR/FATAL"
    ;;
esac

# examine from logfile

if grep '<expression>' "$LOGFILE" >/dev/null; then
    ...
elif grep ...; then
    ...
...
fi

This User Gave Thanks to konsolebox For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reading each line of a file in perl script

HI I need to read each line (test.txt) and store it in a array (@test) How to do it in perl. Suppose i have a file test.txt. I have to read each line of the test.txt file and store it in a array @test. How to do it in perl. Regards Harikrishna (3 Replies)
Discussion started by: Harikrishna
3 Replies

2. Shell Programming and Scripting

Help with perl script while reading a file

Hi Everyone, I am very new to perl, but came across a situation wherein I have to read a c++ header file and write the datatype, its identifier and also the length to an excel file. There can be other header files, in the directory but I should browse through the file which has only "_mef:" string... (9 Replies)
Discussion started by: ramakanth_burra
9 Replies

3. Shell Programming and Scripting

Help need in perl script reading from file

Need perl script, data file will be csv format. I have text file contains 2 colums. Filename Foldernumber aaaa 13455 bbbb 23465 cccc 26689 I have two location 1. files present and 2. folders present. I need to search for file and folder if folder... (3 Replies)
Discussion started by: hnkumar
3 Replies

4. Shell Programming and Scripting

Shell script that will compare two config files and produce 2 outputs 1)actual config file 2)report

Hi I am new to shell scripting. There is a requirement to write a shell script to meet follwing needs.Prompt reply shall be highly appreciated. script that will compare two config files and produce 2 outputs - actual config file and a report indicating changes made. OS :Susi linux ver 10.3. ... (4 Replies)
Discussion started by: muraliinfy04
4 Replies

5. Shell Programming and Scripting

[Solved] perl and grep: get a script to look at more then one file

hi guys i have this very messy script, that looks in /var/log/messages.all for an error and reports if it finds the key works how can i get it to look at more then one file, i.e /var/log/message.all * so it looks in old logs as well thanks exit 0 if (isRenderNode(hostname)); my... (4 Replies)
Discussion started by: ab52
4 Replies

6. Shell Programming and Scripting

Perl Script for reading table format data from file.

Hi, i need a perl script which reads the file, content is given below. and output in new file. TARGET DRIVE IO1 IO2 IO3 IO4 IO5 ------------ --------- --------- --------- --------- --------- 0a.1.8 266 236 ... (3 Replies)
Discussion started by: asak
3 Replies

7. Shell Programming and Scripting

[Solved] Get username, etc. from config file

how can i get the database name from a config file its like this: // ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'userabc_wrdp1'); (there might be spaces in the front of "define") i want to store... (0 Replies)
Discussion started by: vanessafan99
0 Replies

8. Shell Programming and Scripting

[Solved] Reading the last word in a file from a script

Hello everybody, My first time here and my english is not very good I hope you understand me. I'm trying to read a file that contains two zip archive names. Here my file content is: package1.zip package2.zip At the end of the line there is a \n character. I read this file from a... (2 Replies)
Discussion started by: Aurea
2 Replies

9. Shell Programming and Scripting

Need help with perl script with a while loop reading file

Good morning, I appreciate any assistance that I can get from the monks out there. I am able to get this to work for me so that I can do a hostname lookup if I only specify one hostname in the script. What I want to do is have a file with hostnames and do lookups for each name in the file. Here is... (1 Reply)
Discussion started by: brianjb
1 Replies

10. Shell Programming and Scripting

Error while reading variable from a file in perl script

I have a file abc.ini and declared many variables in that file, one of the variable(DBname) value I am trying to read in my perl script but getting error. File abc.ini content # database name DBname =UATBOX my $ex_stat; my $cmd_output; $ex_stat = "\Qawk '/^DBname/{print... (2 Replies)
Discussion started by: Devesh5683
2 Replies
LORAX(1)						      General Commands Manual							  LORAX(1)

NAME
lorax - Create installer boot iso SYNOPSIS
lorax -p PRODUCT -v VERSION -r RELEASE -s REPOSITORY OUTPUTDIR DESCRIPTION
lorax is used to create the installer boot iso. OPTIONS
-h, --help show this help message and exit -V show program's version number and exit REQUIRED ARGUMENTS
: -p STRING, --product=STRING product name -v STRING, --version=STRING version identifier -r STRING, --release=STRING release information -s REPOSITORY, --source=REPOSITORY source repository (may be listed multiple times) OPTIONAL ARGUMENTS
: -m REPOSITORY, --mirrorlist=REPOSITORY mirrorlist repository (may be listed multiple times) -t STRING, --variant=STRING variant name -b URL, --bugurl=URL bug reporting URL for the product --isfinal -c STRING, --config=STRING config file --proxy=STRING repo proxy url:port -e STRING, --excludepkgs=STRING package glob to exclude (may be listed multiple times) --buildarch=STRING build architecture --volid=STRING volume id --nomacboot --noupgrade --logfile=LOGFILE Path to logfile --tmp=TMP Top level temporary directory AUTHORS
Martin Gracik Will Woods Brian C. Lane 2013-07-26 LORAX(1)
All times are GMT -4. The time now is 01:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy