I am doing a basic script to check if services are disabled, and I was wondering how to change to colours for PASS and FAIL to green & red respectively.
#!/usr/bin/bash
clear
TELNET=`svcs -a | grep telnet | awk '{print $1}'`
if
then
RESULT=PASS
else
RESULT=FAIL
fi... (3 Replies)
I have a text wich looks like this:
clid=2 cid=6 client_database_id=35 client_nickname=Peter client_type=0|clid=3 cid=22 client_database_id=57 client_nickname=Paul client_type=0|clid=5 cid=22 client_database_id=7 client_nickname=Mary client_type=0|clid=6 cid=22 client_database_id=6... (3 Replies)
I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it.
For example, Here is a portion of a zone file.
IN NS ns1.domain.tld.
IN NS ns2.domain.tld.
IN ... (2 Replies)
Hi!
I´m all new to Unix and scripts, I´ve tried to write a script for wc with text so the output looks better, can anyone help me please?
I want it like this example:
>textWc file #<scriptname> <file to to run script on>
File: file
Rows: 7
Words: 56
Signs: 1312
> (3 Replies)
I have a command which returns the below output. How can I write a script to extract mainhost and secondhost from this output and put it into an array? I may sometimes have more hosts like thirdhost. I am redirecting this output to a variable. So I guess there should be a awk or sed command to... (7 Replies)
I've a file in linux with following text:
;ip address hostname put-location alt-put-location tftpserver
192.168.1.1 r01-lab1-net /mnt/nas1/fgbu/ /opt/fgbu/devicebackup 192.168.1.254Now I want to read these values and assign them to particular variables... (6 Replies)
Hi Friends,
I have a very big text file, that has code for multiple functions. I have scan through the file and write each function in seperate file. All functions starts with
BEGIN DSFNC
Identifier "ABCDDataValidationfnc"
and ends with
END DSFNC
I need create a file(using identifier)... (2 Replies)
Guys, I have a variable in a script that I want to transform to into something else Im hoping you guys can help. It doesn't have to use sed/awk but I figured these would be the simplest.
DATE=20160120
I'd like to transform $DATE into "01-20-16" and move it into a new variable called... (8 Replies)
I am trying to use awk skip each line with a ## or # and check each line after for STB= and if that value in greater than or = to 0.8, then at the end of line the text "STRAND BIAS" is written in else "GOOD".
So in the file of 4 entries attached.
awk tried:
awk NR > "##"' "#" -F"STB="... (6 Replies)
In the bash below I am asking the user for a panel and reading that into bed. Then asking the user for a file and reading that into file1.Is the grep in bold the correct way to apply the selected panel to the file? I am getting a syntax error. Thank you :)
... (4 Replies)
Discussion started by: cmccabe
4 Replies
LEARN ABOUT SUSE
warnings
warnings(3pm) Perl Programmers Reference Guide warnings(3pm)NAME
warnings - Perl pragma to control optional warnings
SYNOPSIS
use warnings;
no warnings;
use warnings "all";
no warnings "all";
use warnings::register;
if (warnings::enabled()) {
warnings::warn("some warning");
}
if (warnings::enabled("void")) {
warnings::warn("void", "some warning");
}
if (warnings::enabled($object)) {
warnings::warn($object, "some warning");
}
warnings::warnif("some warning");
warnings::warnif("void", "some warning");
warnings::warnif($object, "some warning");
DESCRIPTION
The "warnings" pragma is a replacement for the command line flag "-w", but the pragma is limited to the enclosing block, while the flag is
global. See perllexwarn for more information.
If no import list is supplied, all possible warnings are either enabled or disabled.
A number of functions are provided to assist module authors.
use warnings::register
Creates a new warnings category with the same name as the package where the call to the pragma is used.
warnings::enabled()
Use the warnings category with the same name as the current package.
Return TRUE if that warnings category is enabled in the calling module. Otherwise returns FALSE.
warnings::enabled($category)
Return TRUE if the warnings category, $category, is enabled in the calling module. Otherwise returns FALSE.
warnings::enabled($object)
Use the name of the class for the object reference, $object, as the warnings category.
Return TRUE if that warnings category is enabled in the first scope where the object is used. Otherwise returns FALSE.
warnings::fatal_enabled()
Return TRUE if the warnings category with the same name as the current package has been set to FATAL in the calling module. Otherwise
returns FALSE.
warnings::fatal_enabled($category)
Return TRUE if the warnings category $category has been set to FATAL in the calling module. Otherwise returns FALSE.
warnings::fatal_enabled($object)
Use the name of the class for the object reference, $object, as the warnings category.
Return TRUE if that warnings category has been set to FATAL in the first scope where the object is used. Otherwise returns FALSE.
warnings::warn($message)
Print $message to STDERR.
Use the warnings category with the same name as the current package.
If that warnings category has been set to "FATAL" in the calling module then die. Otherwise return.
warnings::warn($category, $message)
Print $message to STDERR.
If the warnings category, $category, has been set to "FATAL" in the calling module then die. Otherwise return.
warnings::warn($object, $message)
Print $message to STDERR.
Use the name of the class for the object reference, $object, as the warnings category.
If that warnings category has been set to "FATAL" in the scope where $object is first used then die. Otherwise return.
warnings::warnif($message)
Equivalent to:
if (warnings::enabled())
{ warnings::warn($message) }
warnings::warnif($category, $message)
Equivalent to:
if (warnings::enabled($category))
{ warnings::warn($category, $message) }
warnings::warnif($object, $message)
Equivalent to:
if (warnings::enabled($object))
{ warnings::warn($object, $message) }
See "Pragmatic Modules" in perlmodlib and perllexwarn.
perl v5.12.1 2010-04-26 warnings(3pm)