07-10-2013
Thanks Made in Germany, It is working for me.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
dear guys,
I want to replace the beginning of some lines in a file by (,)
The sequence number of lines is located in a file named numbers
so, i used this simple script to do so, but it didn't work. it does'nt recognize the $j in the command sed
#! /bin/sh
for j in `cat numbers`
do
sed '$j... (6 Replies)
Discussion started by: marwan
6 Replies
2. Shell Programming and Scripting
Okay, title is kind of confusion, but basically, I have a lot of scripts on a server that I need to replace a ps command, however, the new ps command I'm trying to replace the current one with pipes to sed at one point. So now I am attempting to create another script that replaces that line.
... (1 Reply)
Discussion started by: cbo0485
1 Replies
3. Shell Programming and Scripting
Hi there,
I have 1 file with different 144 lines and 144 files that I want to change with a sed.
What I want to do is to go trough the file with the 144 different lines take the line a replace a certain pattern with said in the first file of the folder where the 144 files are. Take the second... (3 Replies)
Discussion started by: sickboy
3 Replies
4. UNIX for Dummies Questions & Answers
Hi,
im having problem creating a loop using my code: aside from the fact that the 1st variable (VAR) does not increment, it loops more than the expected output.
for sample purposes, test csv contains 3 lines.
#get number of lines in the file
lines=$( wc -l < test.csv )
... (5 Replies)
Discussion started by: paoie
5 Replies
5. Shell Programming and Scripting
I have a file with just over 1 million lines. I am trying to write a script that will find 1400 instances of two particular patterns and insert a url on the 22nd line after the second pattern is matched. Each line in the text file corresponds to a particular check box or dropdown in the software... (3 Replies)
Discussion started by: midniteslice
3 Replies
6. Shell Programming and Scripting
I have a file MAT.txt which contains the following data:
mat1.txt
mat2.txt
.
.
.
.
mat100.txt
I want to remove the '.txt' from every line and have an output file with the following data:
mat1
mat2
.
.
.
.
mat100
I know this can be done with sed easily for each line, but I do... (8 Replies)
Discussion started by: ursaan
8 Replies
7. UNIX for Dummies Questions & Answers
:wall:
I have a requirement to search a log file that never rotates for certain values. If I find them I pipe them to a another file. To log file is constanyl being appened with new lines and never rotating Easy so far.
The problem is I dont want to pipe out matches already seen before. ... (3 Replies)
Discussion started by: gunnahafta
3 Replies
8. UNIX for Dummies Questions & Answers
Hello
I have a group of files
a1.profile a2.profile a3.profile a4.profile b1.profile b2.profile b3.profile b4.profile These files all have the same first line with a value s1 atop the columns
s1_context s1_ref s1_sample s1_% etc I am trying to use sed in a for loop to replace the s1 in the... (2 Replies)
Discussion started by: plumb_r
2 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I have a file called 1.txt, I want to create 2.txt through 100.txt using a for loop. In each instance of the loop, I want to change all "1"'s in the text file to "2"s and so on...
I tried the code below to do this:
for i in {2..100}; do sed 's/1/$i/g' 1.txt > $i.txt; done
but it... (1 Reply)
Discussion started by: evelibertine
1 Replies
10. Shell Programming and Scripting
Hi,
I am running a script sample.sh in bash environment .In the script i am using sed and awk commands which when executed individually from terminal they are getting executed normally but when i give these sed and awk commands in the script it is giving the below errors :-
./sample.sh: line... (12 Replies)
Discussion started by: satishmallidi
12 Replies
LEARN ABOUT CENTOS
libsmi
libsmi(3) SMI Management Information Library libsmi(3)
NAME
libsmi - library to access SMI management information
DESCRIPTION
This library contains functions that allow access to SMI management information stored in repositories that are managed by libsmi, cur-
rently directories containing SMIv1/v2 and SMIng MIB module files.
The libsmi API is defined in smi.h. Functions are documented in smi_config(3), smi_module(3), smi_node(3), smi_type(3), and smi_macro(3).
The purpose of libsmi is to separate the weird parsing and handling of MIB modules from management applications. MIB modules conforming to
SMIv1, SMIv2 and SMIng - a new language for management information, developed at the Technical University of Braunschweig, Germany - can be
handled by libsmi.
NOTE: SMIng support in the current release of libsmi is neither stable nor representing the work done in the IETF SMING working group. It
is based research efforts at TU Braunschweig and within the IRTF in 1999-2000.
EXAMPLE
#include <stdio.h>
#include <string.h>
#include <smi.h>
int main(int argc, char *argv[])
{
SmiNode *smiNode;
int oidlen, first = 1;
if (argc != 2) {
fprintf(stderr, "Usage: smisubtree oid
");
exit(1);
}
smiInit(NULL);
for((smiNode = smiGetNode(NULL, argv[1])) &&
(oidlen = smiNode->oidlen);
smiNode && (first || smiNode->oidlen > oidlen);
smiNode = smiGetNextNode(smiNode, SMI_NODEKIND_ANY),
first = 0) {
printf("%*s%-32s
",
(smiNode->oidlen - oidlen + 1) * 2, " ",
smiNode->name);
};
exit(0);
}
FILES
/usr/include/smi.h SMI library header file
SEE ALSO
RFCs 2578-2580 specify the SMIv2 standard [STD 58]. The (obsolete) SMIng specification has been a working document of the IRTF Network
Management Working Group (NMRG) (draft-irtf-nmrg-sming-02).
smi.h, smi_config(3), smi_module(3), smi_node(3), smi_type(3), smi_macro(3),
AUTHOR
(C) 1999-2001 Frank Strauss, TU Braunschweig, Germany <strauss@ibr.cs.tu-bs.de>
IBR
August 16, 2001 libsmi(3)