Sponsored Content
Top Forums Shell Programming and Scripting Script to check for few conditions and respond with outputs Post 302856765 by RudiC on Tuesday 24th of September 2013 05:55:14 PM
Old 09-24-2013
Some hints (not exhaustive):
- if you got more than one ccore file in all subdirectories, your tmonth etc. variables will not be unique.
- why are you using four finds to extract those four vars? Use one and extract all variables from that.
- same for the date/time vars
- depending on your find version, you could use its time tests to analyse the one, more, and 24 hour conditions for the ccore files, list and - if need be - delete them, and send mails. No need for the cumbersome shell arithmetics!

Last edited by RudiC; 09-24-2013 at 06:55 PM.. Reason: typo
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script on startup does not respond as expected

Hi, I have a bash script which I have referenced in the rc.local of my fedora linux OS. However it doesnt respond the same as when run in terminal from fedora. The bash script has a series of interactive questions that require user input as shown: #!/bin/bash echo "Do you want to use... (1 Reply)
Discussion started by: Crigamorfin
1 Replies

2. Shell Programming and Scripting

problems with a script that outputs data to a file

First of all, im a total newbie to the point that i do not know what are the terms to search for my problem. I did however spend the rest of the day today trying to figure out what is wrong with my bash script. ive always thought that the best way to learn is to tackle a problem heads on. but at... (1 Reply)
Discussion started by: joeribut
1 Replies

3. Shell Programming and Scripting

Trouble with tee command to capture script outputs

function GetInput { print -n "Input" read input export INPUT=$input } export COMMAND="GetInput" $COMMAND echo "$INPUT" $COMMAND | tee -a Log.log echo "$INPUT" The first one without "tee" works fine. echo "$INPUT" displays the values I type in for input. The second... (5 Replies)
Discussion started by: muthubharadwaj
5 Replies

4. Shell Programming and Scripting

Script that takes in variables, and outputs to another text or script file

Ok, I sort of need to create a command files that will be ftped to another server to run. I have some input variable that will need to be read, and then transformed into another script file. Here are some examples. Server 1: outputCmd.sh passing in ./outputCmd.sh nh8oaxt Release_4_0... (1 Reply)
Discussion started by: orozcom
1 Replies

5. Shell Programming and Scripting

expect script, how to deal with different outputs.

I have an expect script that I need to deal with a few different outputs? Here are the commands I am running ssh -o StrictHostKeyChecking=no root@$ipaddress "racadm config -g cfgIpmiLan -o cfgIpmiLanEnable 1" Now, the system I am running this from if I have connected to the server before I... (0 Replies)
Discussion started by: trey85stang
0 Replies

6. Shell Programming and Scripting

create outputs from other command outputs

hi friends, The code: i=1 while do filename=`/usr/bin/ls -l| awk '{ print $9}'` echo $filename>>summary.csv #Gives the name of the file stored at column 9 count=`wc -l $filename | awk '{print $1}'` echo $count>>summary.csv #Gives just the count of lines of file "filename" i=`expr... (1 Reply)
Discussion started by: rajsharma
1 Replies

7. Shell Programming and Scripting

Script that outputs user logins sorted by duration

Hello, I want to write a script that takes a username as input and outputs the user's logins sorted by duration. Also I want to exclude the "still logged in" entries. I use the "last" command but Im having problems sorting the entries based on the duration. Can you help me? Thanks a lot =) (4 Replies)
Discussion started by: ddante
4 Replies

8. Shell Programming and Scripting

Assign specific Color to the outputs in script

Hi, Im programming an interactive menu that verifies the exports of my oracle DB, and im having some trouble finding a process that outputs for example a green command line when the export terminated successfully. i have something like this cat... (15 Replies)
Discussion started by: blacksteel1988
15 Replies

9. Shell Programming and Scripting

Linux Shell: how to check a string whether meets some conditions

Hi, guys. In Linux Shell script, how can I check a string whether meets some conditions. e.g.: If a string str must start with a underscore or a alphabet, and it must contains at least one lowercase, one uppercase, one numeric and one punctuation, and its length must be more than 8 characters... (2 Replies)
Discussion started by: franksunnn
2 Replies

10. Shell Programming and Scripting

How to Check Multiple conditions in IF statement?

I wish to check two conditions inside the if statement Condition 1: The two file contents should be identical // using cmp command for this. Condition 2: The two filenames should NOT be the same. This is what i did in vain. if ]; then where entry1 and entry2 are ls *.txt | while... (7 Replies)
Discussion started by: mohtashims
7 Replies
Smokeping_probes_basevars(3)					     SmokePing					      Smokeping_probes_basevars(3)

NAME
Smokeping::probes::basevars - Another Base Class for implementing SmokePing Probes OVERVIEW
Like Smokeping::probes::base, but supports host-specific variables for the probe. SYNOPSIS
*** Probes *** +basevars offset = 50% pings = 20 step = 300 # [...] *** Targets *** probe = basevars # if this should be the default probe # [...] + mytarget # probe = basevars # if the default probe is something else host = my.host DESCRIPTION
Provides the method `targets' that returns a list of hashes. The hashes contain the entries: addr The address of the target. vars A hash containing variables defined in the corresponding config section. tree The unique index that `probe::base' uses for targets. There's also the method 'vars' that returns the abovementioned hash corresponding to the 'tree' index parameter. VARIABLES
Supported probe-specific variables: offset If you run many probes concurrently you may want to prevent them from hitting your network all at the same time. Using the probe- specific offset parameter you can change the point in time when each probe will be run. Offset is specified in % of total interval, or alternatively as 'random', and the offset from the 'General' section is used if nothing is specified here. Note that this does NOT influence the rrds itself, it is just a matter of when data acqusition is initiated. (This variable is only applicable if the variable 'concurrentprobes' is set in the 'General' section.) Example value: 50% pings How many pings should be sent to each target, if different from the global value specified in the Database section. Note that the number of pings in the RRD files is fixed when they are originally generated, and if you change this parameter afterwards, you'll have to delete the old RRD files or somehow convert them. Example value: 20 step Duration of the base interval that this probe should use, if different from the one specified in the 'Database' section. Note that the step in the RRD files is fixed when they are originally generated, and if you change the step parameter afterwards, you'll have to delete the old RRD files or somehow convert them. (This variable is only applicable if the variable 'concurrentprobes' is set in the 'General' section.) Example value: 300 AUTHORS
Niko Tyni <ntyni@iki.fi> BUGS
Uses `Smokeping::probes::base' internals too much to be a derived class, but I didn't want to touch the base class directly. SEE ALSO
Smokeping::probes::base, Smokeping::probes::EchoPing 2.6.8 2013-03-17 Smokeping_probes_basevars(3)
All times are GMT -4. The time now is 08:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy