Sponsored Content
Full Discussion: Fooling files
Top Forums Shell Programming and Scripting Fooling files Post 302463001 by ultimatix on Friday 15th of October 2010 01:01:17 PM
Old 10-15-2010
Hi methyl

Thanks for ur help ... ur script tickled my brains gray matter and what i have done is this

Code:
curr_date=`date +'%d'`
cntr=0;
while read line
do
if [ -e "${line}" ]
then
if [ `ls -lrt $line | awk {'print$7'}` -eq $curr_date ]
then
let cntr=$cntr+1
fi
fi
done < file_list

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to retrieve all the linked script files/ctl files/sql files?

Hi I am going to migrate our datawarehouse system from HP Tru 64 Unix to the Red Hat Linux. Inside the box, it is running around 40 cron jobs; inside each cron job, it is calling other shell script files, and the shell script files may again call other shell script files or ctl files(for... (1 Reply)
Discussion started by: franksubramania
1 Replies

2. Shell Programming and Scripting

How to extract data from indexed files (ISAM files) maintained in an unix server.

Hi, Could someone please assist on a quick way of How to extract data from indexed files (ISAM files) maintained in an UNIX(AIX) server.The file data needs to be extracted in flat text file or CSV or excel format . Usually we have programs in microfocus COBOL to extract data, but would like... (2 Replies)
Discussion started by: devina
2 Replies

3. UNIX for Dummies Questions & Answers

write a program in c in unix that display the files(includ sub-direc and files within) in a sorted

the sorting is based on name of file, file size modification time stamps o f file it should dislay the output in the following format "." and ".." enteries should be ignored please give some idea how to do it (1 Reply)
Discussion started by: pappu kumar jha
1 Replies

4. Shell Programming and Scripting

need a shell script to extract the files from source file and check whether those files existonserve

Hi, I am new to shell scripting.Please help me on this.I am using solaris 10 OS and shell i am using is # echo $0 -sh My requirement is i have source file say makefile.I need to extract files with extensions (.c |.cxx |.h |.hxx |.sc) from the makefile.after doing so i need to check whether... (13 Replies)
Discussion started by: muraliinfy04
13 Replies

5. Shell Programming and Scripting

How to create zip/gz/tar files for if the files are older than particular days in UNIX or Linux?

I need a script file for backup (zip or tar or gz) of old log files in our unix server (causing the space problem). Could you please help me to create the zip or gz files for each log files in current directory and sub-directories also? I found one command which is to create gz file for the... (4 Replies)
Discussion started by: Mallikgm
4 Replies

6. Shell Programming and Scripting

Bash script deleting my files, and editing files in subdirectories question

#!/bin/bash # name=$1 type=$2 number=1 for file in ./** do if then filenumber=00$number elif then filenumber=0$number fi tempname="$name""$filenumber"."$type" if (4 Replies)
Discussion started by: TheGreatGizmo
4 Replies

7. Shell Programming and Scripting

Append string to all the files inside a directory excluding subdirectories and .zip files

Hii, Could someone help me to append string to the starting of all the filenames inside a directory but it should exclude .zip files and subdirectories. Eg. file1: test1.log file2: test2.log file3 test.zip After running the script file1: string_test1.log file2: string_test2.log file3:... (4 Replies)
Discussion started by: Ravi Kishore
4 Replies

8. Shell Programming and Scripting

Shell script for field wise record count for different Files .csv files

Hi, Very good wishes to all! Please help to provide the shell script for generating the record counts in filed wise from the .csv file My question: Source file: Field1 Field2 Field3 abc 12f sLm 1234 hjd 12d Hyd 34 Chn My target file should generate the .csv file with the... (14 Replies)
Discussion started by: Kirands
14 Replies

9. UNIX for Beginners Questions & Answers

Automate splitting of files , scp files as each split completes and combine files on target server

i use the split command to split a one terabyte backup file into 10 chunks of 100 GB each. The files are split one after the other. While the files is being split, I will like to scp the files one after the other as soon as the previous one completes, from server A to Server B. Then on server B ,... (2 Replies)
Discussion started by: malaika
2 Replies
HBA_GetFcpTargetMapping(3HBAAPI)              Common Fibre Channel HBA Information Library Functions              HBA_GetFcpTargetMapping(3HBAAPI)

NAME
HBA_GetFcpTargetMapping, HBA_GetFcpTargetMappingV2 - retrieve mapping between FCP-2 discovered devices and operating system SCSI informa- tion SYNOPSIS
cc [ flag... ] file... -lHBAAPI [ library... ] #include <hbaapi.h> HBA_STATUS HBA_GetFcpTargetMapping(HBA_HANDLE handle, HBA_FCPTARGETMAPPING *mapping); HBA_STATUS HBA_GetFcpTargetMappingV2(HBA_HANDLE handle, HBA_WWN hbaPortWWN, HBA_FCPTARGETMAPPINGV2 *mapping); PARAMETERS
handle an open handle returned from HBA_OpenAdapter(3HBAAPI) mapping a buffer in which to store the mapping entries. The mapping->NumberOfEntries member must indicate the maximum number of entries that will fit within the buffer. On completion, the mapping->NumberOfEntries member indicates the actual number of mapping entries for the HBA. This value can be greater than the number of entries the buffer can store. hbaPortWWN the Port Name of the local HBA Port for which the caller is requesting target mappings. DESCRIPTION
The HBA_GetFcpTargetMapping() function retrieves the current set of mappings between FCP LUNs and SCSI LUNs for a given HBA port. The HBA_GetFcpTargetMappingV2() function retrieves the current set of mappings between FCP LUNs and SCSI LUNs for a given HBA. The mapping also includes a Logical Unit Unique Identifier for each logical unit. RETURN VALUES
The HBA_GetFcpTargetMappingV2() function returns the following values: HBA_STATUS_ERROR_ILLEGAL_WWN The port WWN specified by hbaPortWWN is not a valid port WWN on the specified HBA HBA_STATUS_ERROR_NOT_SUPPORTED Target mappings are not supported on the HBA. HBA_STATUS_ERROR An error occurred. The HBA_GetFcpTargetMapping() and HBA_GetFcpTargetMappingV2() functions return the following values: HBA_STATUS_OK The HBA was able to retrieve information. HBA_STATUS_ERROR_MORE_DATA A larger buffer is required. The value of mapping->NumberOfEntries after the call indicates the total number of entries available. The caller should reallocate the buffer large enough to accomodate the indicated number of entries and reissue the routine. In the event that other error values are returned, the value of mapping->NumberOfEntries after the call should be checked, and if greater than the value before the call, a larger buffer should be allocated for a retry of the routine. ERRORS
See libhbaapi(3LIB) for general error status values. EXAMPLES
Example 1: Return target mapping data. The following example returns target mapping data. It initially allocates space for one target mapping. If the number of entries returned is greater than the allocated space, a new buffer with sufficient space is allocated and HBA_GetFcpTargetMapping() is called again. map = (HBA_FCPTARGETMAPPING *)calloc(1, sizeof (HBA_FCPTARGETMAPPING)); status = HBA_GetFcpTargetMapping(handle, map); if (map->NumberOfEntries > 0) { HBA_UINT32 noe = map->NumberOfEntries; free(map); map = (HBA_FCPTARGETMAPPING *)calloc (1, sizeof (HBA_FCPTARGETMAPPING) + (sizeof (HBA_FCPSCSIENTRY)*(noe - 1))); map->NumberOfEntries = noe; if ((status = HBA_GetFcpTargetMapping(handle, map)) != HBA_STATUS_OK) { fprintf(stderr, " Failed to get target " "mappings %d", status); free(map); } else { printf(" FCP Mapping entries: "); for (cntr = 0; cntr < map->NumberOfEntries; cntr ++) { printf(" Path(%d): "%s" ", cntr, map->entry[cntr].ScsiId.OSDeviceName); } } } ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard: FC-MI 1.92 (API | | |version 1) | +-----------------------------+-----------------------------+ | |Standard: FC-HBA Version 4 | | |(API version 2) | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
HBA_OpenAdapter(3HBAAPI), libhbaapi(3LIB), attributes(5) T11 FC-MI Specification BUGS
The HBA_GetFcpTargetMapping() routine does not take a portindex to define which port of a multi-ported HBA the command should apply to. The behavior on multi-ported HBAs is vendor specific, and may result in mappings or bindings for all ports being intermixed in the response buffer. SNIA version 2 defines a HBA_GetFcpTargetMappingV2() which takes a Port WWN as an argument. This fixes the bug with multi-ported HBAs in HBA_GetFcpTargetMapping(). SunOS 5.10 1 Sep 2003 HBA_GetFcpTargetMapping(3HBAAPI)
All times are GMT -4. The time now is 05:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy