Sponsored Content
Top Forums Shell Programming and Scripting Need Linux equivalent for UNIX Post 302943502 by Don Cragun on Saturday 9th of May 2015 05:49:10 AM
Old 05-09-2015
After more than 375 posts, I am very disappointed that you still don't have any idea how to write a simple for or while loop using a standard shell! And, the title of this thread doesn't give any indication of what you are trying to do.

You were also very skimpy with details about whether or not all of your directories will actually contain a log file for the desired hostname, how the variables hostname, fdrdate, and greptime are set, nor where the log directory is located.

Maybe the following will give you a starting point:
Code:
#!/bin/ksh
#set -xv
basedir="/path/of/log"
fdrdate_new=${1:-fdrdate_new default value}
greptime=${2:-greptime default value}
hostname=${1:-default hostname}
looking=1
cd "$basedir"
ls -td * | while [ "$looking" ] && read fn
do
	if [ ! -d "$fn" ]
	then	continue
	fi
	if grep "$greptime.*exit" "$fn/Prod.$hostname.log" | grep "$fdrdate_new"
	then	echo "Match found in file: $fn/Prod.$hostname.log"
		looking=
	else	echo "No match found in file: $fn/Prod.$hostname.log"
	fi
done
if [ "$looking" ]
then	echo "No match found."
	exit 1
fi

 

10 More Discussions You Might Find Interesting

1. Linux

Linux equivalent for daemon2

Hi all... In my Unix system a program exists called "daemon2" which is responsible to enqueue program executions. For example, if I want to make the system to enqueue lpr executions for certain users, I call daemon2 with lpr as the parameter. Is there an equivalent in Linux? Thanks Jaime (0 Replies)
Discussion started by: jstuardo
0 Replies

2. UNIX for Advanced & Expert Users

ufsdump equivalent in linux and unix

Hi all, I am preparing for a worst case scenario. Say i have a production server A, should A fails ( for whatever reason), i want another server B to take over. How can i move everything from A to B? Assuming i have regular backup of A. I've searched in the forums, and briefly came across... (4 Replies)
Discussion started by: new2ss
4 Replies

3. UNIX for Advanced & Expert Users

Equivalent for iostat -e in AIX HP-UX Linux

iostat -e gives the soft, hard and transport error information in Solaris. What is the equivalent command in the other flavors of Unix AIX HP Linux. Thanks Prasi (1 Reply)
Discussion started by: prasi_in
1 Replies

4. UNIX for Advanced & Expert Users

ACF2 equivalent in Unix or Linux ?

In IBM Mainframe they have something called ACF2 rule which is essentially used to control the dataset access. It is kind of a list-based access control for mainframe datasets. Is there anything equivalent to ACF2 available in Unix ? Thanks Rabi (1 Reply)
Discussion started by: indra_saha
1 Replies

5. Linux

Mksysb Equivalent For Linux?

I have experience with making bootable images of AIX systems using mksysb and wondered if there was some type of equivalent software for Linux. Or perhaps some of the folks here have alternatives or unique ideas for how they are backing up their Linux systems enabling them to recover them as... (13 Replies)
Discussion started by: scotbuff
13 Replies

6. Linux

Linux equivalent for...

I moved to a Linux system from Windows a few months ago. Most of the programs I had been using were already native to Linux (Firefox, the GIMP, Pari, etc.) and most others I found a close enough program (Crimson Editor -> gedit, Visual Studio -> KDevelop, Primo -> Morain's ECPP). Now I'm down... (1 Reply)
Discussion started by: CRGreathouse
1 Replies

7. Programming

WSAAsyncSelect equivalent for linux

Hello, I'm writing a multi-threaded socket server in C++ and I needed something like wsaasyncselect to handle messages like fd_accept, fd_read, fd_connect, fd_close. Thanks in advance. (2 Replies)
Discussion started by: lucastonon
2 Replies

8. HP-UX

UNIX VI editor equivalent of LINUX

Hi All, I am comfortable working in LINUX and need equivalents for HP-UX for below mentioned, 1. We use TAB key to expand/reveal a name in LINUX. Is there any way to make this work for UNIX, where it is double escape. 2. Also can we use make use of left,down,up,right keys instead... (3 Replies)
Discussion started by: pradebban
3 Replies

9. Linux

/etc/netmasks equivalent in linux

Hi Guys, I am used to configuring DHCP on Solaris and foreach subnet added I place a corresponding entry in /etc/netmasks. I am now looking at configuring DHCP on linux, is there an equivalnet entry required somewhere or is this not needed in linux Thanks (3 Replies)
Discussion started by: eeisken
3 Replies

10. Red Hat

NFS_v4_fail_over_timeout equivalent in Linux

Hi, I need to mount a replicated nfs4 export on a number of AIX and Redhat hosts. To get the failover on the clients working smoothly, I need to change certain values on the AIX boxes like nfs_v4_fail_over_timeout, timeo and retrans values. Since I have no clue about Linux, I am not quite sure... (1 Reply)
Discussion started by: zxmaus
1 Replies
NEW(1)                                                               [nmh-1.5]                                                              NEW(1)

NAME
new - report on folders with new messages fnext - set current folder to next folder with new messages fprev - set current folder to previous folder with new messages unseen - scan new messages in all folders with new messages SYNOPSIS
new [sequences] [-mode mode] [-folders foldersfile] [-version] [-help] fnext is equivalent to new -mode fnext fprev is equivalent to new -mode fprev unseen is equivalent to new -mode unseen DESCRIPTION
New in its default mode produces a one-line-per-folder listing of all folders containing messages in the listed sequences or in the sequences listed in the profile entry "Unseen-Sequence". Each line contains the folder, the number of messages in the desired sequences, and the message lists from the .mh_sequences file. For example: foo 11.* 40-50 bar 380. 760-772 824-828 total 391. The `*' on foo indicates that it is the current folder. The last line shows the total number of messages in the desired sequences. New crawls the folder hierarchy recursively to find all folders, and prints them in lexicographic order. Override this behavior by provid- ing foldersfile containing the pre-sorted list of folders new should check, one per line. In fnext and fprev modes, new instead changes to the next or previous matching folder, respectively. In unseen mode, new executes scan sequences for each matching folder. FILES
$HOME/.mh_profile The user profile PROFILE COMPONENTS
Path: To determine the user's nmh directory Current-Folder: To find the default current folder Unseen-Sequence: The name of the unseen message sequence SEE ALSO
scan(1), mh-format(5) HISTORY
Based on Luke Mewburn's new (http://www.mewburn.net/luke/src/new). MH.6.8 11 June 2012 NEW(1)
All times are GMT -4. The time now is 07:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy