Sponsored Content
Full Discussion: BASH ZCAT EGREP Shell Script
Top Forums Shell Programming and Scripting BASH ZCAT EGREP Shell Script Post 302720103 by pamu on Tuesday 23rd of October 2012 01:11:05 PM
Old 10-23-2012
try using

Code:
zcat /var/log/syslog.*.gz | grep "^$err_date"

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

bash shell script

im trying to teach my self bash shell scripting. i want to include command line arguments in my script i am writing for practice. when i run my script it dosnt make a difference what arguments there are, it just out puts the error message as if there were none. here is the check_opts () function in... (4 Replies)
Discussion started by: norsk hedensk
4 Replies

2. UNIX for Dummies Questions & Answers

need help with bash shell script

Hi guys! I have just started with shell programming!! I am having pronblem with variable subsitutuion. when i do egrep "*" marks this will give me the pattern match. but how can i catch the output of that result in a variable. if i say result = egrep "*" marks it gives me syntax... (2 Replies)
Discussion started by: vmtailor
2 Replies

3. Shell Programming and Scripting

Bash Shell script--need help

Hi all, i am beginner to unix and trying out a shell script which does the following. i have to calculate a persons salary. his salary is read from the keyboard. he has two types of deductions. 40% as dearness allowance and 20% as house rent. i have to print the gross salary. here is the code... (5 Replies)
Discussion started by: Irishboy24
5 Replies

4. Shell Programming and Scripting

bash: need to have egrep to return a text string if the search pattern has NOT been found

Hello all, after spending hours of searching the web I decided to create an account here. This is my first post and I hope one of the experts can help. I need to resolve a grep / sed / xargs / awk problem. My input file is just like this: ----------------------------------... (6 Replies)
Discussion started by: bash4ever
6 Replies

5. Shell Programming and Scripting

Bash shell script to check if script itself is running

hi guys we've had nagios spewing false alarm (for the umpteenth time) and finally the customer had enough so they're starting to question nagios. we had the check interval increased from 5 minutes to 2 minutes, but that's just temporary solution. I'm thinking of implementing a script on the... (8 Replies)
Discussion started by: hedkandi
8 Replies

6. Shell Programming and Scripting

Need help with bash shell script

I need to create digit day script that takes a single numeric argument and then it should print out the day of the week using the number modulo 7 formula e.g: 0 - Sunday 6- Saturday 131 - Friday I am fairly new to unix so I don't know how to use the number modulo 7 formula. Does the script need... (3 Replies)
Discussion started by: lukefrost96
3 Replies

7. Shell Programming and Scripting

Help with Bash shell script

Hi All, I have a script which as below #!/bin/bash for i in `cat servers` do ssh uname@$i "df -t xfs --total | grep total"; done > out.txtOutput as below -------------- total 140583991104 118622795524 21961195580 85% - total 140583991104 112888595524 27695395580 ... (4 Replies)
Discussion started by: npk
4 Replies

8. Shell Programming and Scripting

Different behavior between bash shell and bash script for cmd

So I'm trying to pass certain json elements as env vars and use them later on in a script. Sample json: JSON='{ "Element1": "file-123456", "Element2": "Name, of, company written in, a very weird way", "Element3": "path/to/some/file.txt", }' (part of the) script: for s... (5 Replies)
Discussion started by: da1
5 Replies

9. UNIX for Beginners Questions & Answers

In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed

In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed ? Is there any way to get the script names for the process command ? --- Post updated at 08:39 AM --- in KSH (Korn Shell), my command output shows the script names but when run in the Bash Shell... (3 Replies)
Discussion started by: i4ismail
3 Replies

10. UNIX for Beginners Questions & Answers

Bash shell script help

Hi everyone, first time poster so I hope you'll be gentle with me. :o I am needing some help to make a script in bash to do the following: For each file with a name beginning with the string ff_ Extract the first line of the file (the date) Change "-" to "/" in the date entry to create a... (3 Replies)
Discussion started by: pierreDefuncto
3 Replies
STOREBACKUPDEL(1)					User Contributed Perl Documentation					 STOREBACKUPDEL(1)

NAME
storeBackupDel.pl - this program deletes backups created by storeBackup SYNOPSIS
storeBackupDel.pl [-f configFile] [--print] [-b backupDirectory] [-S series] [--doNotDelete] [--deleteNotFinishedDirs] [-L lockFile] [--keepAll timePeriod] [--keepWeekday entry] [--keepFirstOfYear] [--keepLastOfYear] [--keepFirstOfMonth] [--keepLastOfMonth] [--keepFirstOfWeek] [--keepLastOfWeek] [--keepDuplicate] [--keepMinNumber] [--keepMaxNumber] [-l logFile [--plusLogStdout] [--suppressTime] [-m maxFilelen] [[-n noOfOldFiles] | [--saveLogs] [--compressWith compressprog]] WARNING
!!! USAGE IN PARALLEL WITH storeBackup.pl CAN DESTROY YOUR BACKUPS !!! OPTIONS
--file, -f configuration file (instead of parameters) --print print configuration read from configuration file and stop --backupDir, -b top level directory of all backups (must exist) --series, -S directory of backup series same parameter as in storeBackup / relative path from backupDir, default is 'default' --lockFile, -L lock file, if exists, new instances will finish if an old is already running, default is $lockFile --doNotDelete test only, do not delete any backup --deleteNotFinishedDirs delete old backups which where not finished this will not happen if doNotDelete is set --keepAll keep backups which are not older than the specified amount of time. This is like a default value for all days in --keepWeekday. Begins deleting at the end of the script the time range has to be specified in format 'dhms', e.g. 10d4h means 10 days and 4 hours default = $keepAll; --keepWeekday keep backups for the specified days for the specified amount of time. Overwrites the default values chosen in --keepAll. 'Mon,Wed:40d Sat:60d10m' means: keep backups of Mon and Wed 40days + 5mins keep backups of Sat 60days + 10mins keep backups of the rest of the days like spcified in --keepAll (default $keepAll) if you also use the 'archive flag' it means to not delete the affected directories via --keepMaxNumber: a10d4h means 10 days and 4 hours and 'archive flag' e.g. 'Mon,Wed:a40d Sat:60d10m' means: keep backups of Mon and Wed 40days + 5mins + 'archive' keep backups of Sat 60days + 10mins keep backups of the rest of the days like specified in --keepAll (default $keepAll) --keepFirstOfYear do not delete the first backup of a year format is timePeriod with possible 'archive flag' --keepLastOfYear do not delete the last backup of a year format is timePeriod with possible 'archive flag' --keepFirstOfMonth do not delete the first backup of a month format is timePeriod with possible 'archive flag' --keepLastOfMonth do not delete the last backup of a month format is timePeriod with possible 'archive flag' --firstDayOfWeek default: 'Sun'. This value is used for calculating --keepFirstOfWeek and --keepLastOfWeek --keepFirstOfWeek do not delete the first backup of a week format is timePeriod with possible 'archive flag' --keepLastOfWeek do not delete the last backup of a week format is timePeriod with possible 'archive flag' --keepDuplicate keep multiple backups of one day up to timePeriod format is timePeriod, 'archive flag' is not possible default = $keepDuplicate; --keepMinNumber Keep that miminum of backups. Multiple backups of one day are counted as one backup. Default is 10. --keepMaxNumber Try to keep only that maximum of backups. If you have more backups, the following sequence of deleting will happen: - delete all duplicates of a day, beginning with the old once, except the oldest of every day - if this is not enough, delete the rest of the backups beginning with the oldest, but *never* a backup with the 'archive flag' or the last backup --keepRelative, -R Alternative deletion scheme. If you use this option, all other keep options are ignored. Preserves backups depending on their *relative* age. Example: -R '1d 7d 2m 3m' will (try to) ensure that there is always - One backup between 1 day and 7 days old - One backup between 5 days and 2 months old - One backup between 2 months and 3 months old If there is no backup for a specified timespan (e.g. because the last backup was done more than 2 weeks ago) the next older backup will be used for this timespan. --logFile, -l log file (default is STDOUT) --plusLogStdout if you specify a log file with --logFile you can additionally print the output to STDOUT with this flag --suppressTime suppress output of time in logfile --maxFilelen, -m maximal length of file, default = 1e6 --noOfOldFiles, -n number of old log files, default = 5 --saveLogs save log files with date and time instead of deleting the old (with [-noOldFiles]) --compressWith compress saved log files (e.g. with 'gzip -9') default is 'bzip2' COPYRIGHT
Copyright (c) 2003-2008 by Heinz-Josef Claes (see README). Published under the GNU General Public License v3 or any later version perl v5.14.2 2012-06-16 STOREBACKUPDEL(1)
All times are GMT -4. The time now is 01:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy