9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to find two matches in the output from ps. I am searching with ps -ef |grep mysql for:
my.cnf
/bin/sh /usr/bin/mysqld_safe --defaults-file=/data/mysql/master/agis_core/etc/my.cnf
after this match I want to search back and match the hostname which is x number of lines back, above the... (2 Replies)
Discussion started by: bash_in_my_head
2 Replies
2. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
3. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
4. UNIX for Advanced & Expert Users
Hi, everyone.
I need to write a program to get io info based on libperfstat.
But the "write time" of a disk is just half of the value get from iostat.
I'm confused and can't explain. Help please.
How I calculate "write service time per sec":
In iostat:
write service... (0 Replies)
Discussion started by: jackliang
0 Replies
5. Shell Programming and Scripting
Please see the following code, why "aab" matchs "ab" when using reglar expression ?
$ ] && echo "ok" || echo "error";
ok
$ ] && echo "ok" || echo "error";
error
$ ] && echo "ok" || echo "error";
error
$ ] && echo... (8 Replies)
Discussion started by: 915086731
8 Replies
6. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
7. Shell Programming and Scripting
hello,
I am writting a regular expression that intend to match any tunnel or serial interface but it doesn't mtach any serial sub-interface.
For example, statement should match "Tunnel3" or "Serial0/1" but shouldn't match "Serial0\1.1" (doesn't include dot ".")
I tried the following but... (3 Replies)
Discussion started by: ahmed_zaher
3 Replies
8. Shell Programming and Scripting
I have 2000 files named like "file-fr0000.log", "file-fr1999.log"...
I wanna generate the file names automatically in the following c shell script:
set fr = 0
while ($fr <= 1999)
grep "ENERGY" file-fr$fr.log > data.dat
@ fr = ( $fr + 1 )
end
The above will generate file names... (3 Replies)
Discussion started by: rockytodd
3 Replies
9. Linux
Regular expression to extract "y" from "abc/x.y.z" (2 Replies)
Discussion started by: rag84dec
2 Replies
Regexp(3I) InterViews Reference Manual Regexp(3I)
NAME
Regexp - regular expression searching
SYNOPSIS
#include <InterViews/regexp.h>
DESCRIPTION
A Regexp encapsulates a regular expression pattern and defines operations for searching and matching the pattern against a string. The
syntax of the regular expression pattern is the same as that for ed(1). Information can be obtained about the most recent match of the
regular expression (and its sub-expressions).
PUBLIC OPERATIONS
Regexp(const char* pattern)
Regexp(const char* pattern, int length)
Construct a new Regexp for pattern.
int Match(const char* text, int length, int index)
Attempt a match against text (of length length) at position index. The return value is the length of the matching string, or a neg-
ative number if the match failed.
int Search(const char* text, int length, int index, int range)
Search for a match in the string text (of length length). Matches are attempted starting at positions between index and index plus
range. If range is positive the first match after index is reported. If range is negative the first match before index is
reported. The return value is the index of the starting position of the match, or a negative number if there is no match in the
specified range.
int BeginningOfMatch(int subexp)
int EndOfMatch(int subexp)
Return information about the most recent match. If subexp is zero (the default), information is reported for the complete regular
expression. Other values of subexp refer to sub-expressions in the pattern. For example, if subexp is 2, information is returned
for the sub-expression specified by the second pair of ( and ) delimiters in the pattern.
SEE ALSO
ed(1)
InterViews 23 May 1989 Regexp(3I)