Hi Guys/Gals,
I have a log file that is updated once every few seconds and I am looking for a way to speed up one of my scripts.
Basically what I am trying to do is grep through a text file from start to finish once. Then each subsequent grep starts at the last line of the previous grep to... (4 Replies)
Hi All
I have a script which has produced a list, I have used 'sed' to number my list, but i want to list at end of line with the first line starting at zero (0) and brackets round it
ie
My List i want
Hello (0)
this (1)
day (2)
can (3)
be (4)
sed '/./=' filename | sed '/./N; s/\n/) /'... (5 Replies)
Hi
I want to find whether the argument passed to my script ends in a number or not. Like, I want to find out if the argument is of the form: xyzwpq123 or just of the form xyzwpq.
Can someone please help me!?
Thanks (2 Replies)
Hi Folks,
Using the Vi, how can I add a numbers at the end of the line.
For eg: I have the numbers in the file as:
58.125.33
22.58.68
25.144.225
114.25.38
I need to add .0/8 at the end of all the line. So, it should be like
58.125.33.0/8
22.58.68.0/8
25.144.225.0/8
114.25.38.0/8 (6 Replies)
Hi there, I have a bunch of interface names like
e1000g0
nge1
dmfe3
I also have some that have longer (vlan tagged) names
like
e1000g123001
nge23003
e1000g999002
I need to determine whether the interface is one of the former or latter types and I would do that by seeing... (7 Replies)
Does anyone know how to use awk to act like grep from a particular line number to the end of file? I am using Solaris 10 and I don't have any GNU products installed.
Say I want to print all occurrences of red starting at line 3 to the end of file.
EXAMPLE FILE:
red
green
red
red... (1 Reply)
Hi Power User,
I'm trying to compute this kind of text file format:
file1:
jakarta 100 150
jakarta 170 210
beijing 220 250
beijing 260 280
beijing 290 320
new_york 330 350
new_york 370 420
tokyo 430 470
tokyo 480 ... (2 Replies)
hi team,
i need a script for renaming a file with sequence number. script get a file from one directory'/home/billing/Cmm/sms/sms_tmp' append sequence no at the end of file name and move a file to other directory/home/billing/Cmm/sms/.
actual file is cdr201508271527 file after renaming ... (3 Replies)
I have a factor program that runs and outputs to stdout all the prime numbers that are specified in the given paramters, in this case 30000000-31000000.
Command:
factor/factor 30000000-31000000
Sample output:
30999979 = 30999979
30999980 = 2^2 5 11 140909
30999981 = 3 10333327... (6 Replies)
Hi ,
Please help me out for the below problem -
I have 2 files in a directory -
$ ls -ltr
total 4
-rwx------+ 1 abc Domain Users 615 May 31 17:33 abc.txt
-rwx------+ 1 abc Domain Users 0 May 31 17:33 ll.sh
I want to write the filename of abc.txt along with the directory to the... (2 Replies)
Discussion started by: Pratik4891
2 Replies
LEARN ABOUT HPUX
dtdtsdatatodatatype
DtDtsDataToDataType(library call) DtDtsDataToDataType(library call)
NAME
DtDtsDataToDataType -- get the data type for a set of data
SYNOPSIS
#include <Dt/Dts.h>
char *DtDtsDataToDataType(
const char *filepath,
const void *buffer,
const int size,
const struct stat *stat_buff,
const char *link_path,
const struct stat *link_stat_buff,
const char *opt_name);
DESCRIPTION
The DtDtsDataToDataType function determines the data type of a set of data, based on the information given in the non- NULL pointer argu-
ments to the function. The function gathers any additional information, if it is needed, to compensate for the NULL arguments. For exam-
ple, if the filepath argument is given, but the stat_buff argument is NULL and a stat_buff value is required to determine the data type,
DtDtsDataToDataType calls the stat(2) function to obtain the information.
The filepath argument is the pathname of a file.
The buffer argument is a pointer to the buffer of the data to be typed.
The size argument is the size of the buffer in bytes.
The stat_buff argument is the buffer returned from a stat(2) or fstat(3) call for use in typing.
The link_path argument is the pathname of the target file pointed to by a symbolic link.
The link_stat_buff argument is the buffer returned from an lstat(2) call for use in typing.
The opt_name argument can be used to specify a name to be associated with the buffer. If the opt_name argument is not NULL, it is used as
a pseudo file name in typing; otherwise, certain attributes may be returned as NULL because the filename components could not be deter-
mined.
RETURN VALUE
Upon successful completion, the DtDtsDataToDataType function returns a pointer to a data type string, or NULL if no value could be deter-
mined.
APPLICATION USAGE
The DtDtsDataToDataType function is generally used by applications such as file managers to improve performance. Typical applications
should probably use DtDtsFileToDataType(3) or DtDtsBufferToDataType(3) instead.
The DtDtsBuffer* functions assume that the buffer is readable and writable by the user, group and other file classes and select a type
accordingly. An application requiring a type based on read-only permissions should use DtDtsDataToDataType with a stat_buff value created
for this purpose: all fields should NULL except for the st_mode field, which should be set to:
S_IFREG | S_IROTH | S_IRGRP | S_IRUSR
SEE ALSO
Dt/Dts.h, DtDtsLoadDataTypes(3), DtDtsFileToDataType(3), DtDtsBufferToDataType(3), fstat(3), lstat(2), stat(2).
DtDtsDataToDataType(library call)