10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I have file on which I do grep on "/tmp/data" then I get 5 lines as
dir Path: /tmp/data/20162343134
Starting to listen on ports logging:
--
Moving results files from local storage: /tmp/resultsFiles/20162343134/*.gz to NFS: /data/temp/20162343134/outgoing
from above got to get... (7 Replies)
Discussion started by: girijajoshi
7 Replies
2. Shell Programming and Scripting
I have one requirement to delete all lines from a file if it matches below scenario. File contains three column. Employee Number, Employee Name and Employee ID
Scenario is: delete all line if Employee Number (1st column) contains below
1. Non-numeric Employee Number
2. Employee Number that... (3 Replies)
Discussion started by: anshu ranjan
3 Replies
3. Shell Programming and Scripting
I have a directory of files, each with a variable (though small) number of lines. I would like to go through each line in each file, and print the:
-file name
-line number
-number of matches to the pattern /comp/ for each line.
Two example files:
cat... (4 Replies)
Discussion started by: pathunkathunk
4 Replies
4. Shell Programming and Scripting
Im trying to parse ifconfig with awk and setup a bunch of variables in one shot. But Im having trouble figuring out how to work with data in previous lines.
ifconfig output:
eth0 Link encap:Ethernet HWaddr 00:50:DA:10:7F:1B
inet addr:10.10.10.10 Bcast:10.10.10.127 ... (0 Replies)
Discussion started by: trey85stang
0 Replies
5. Shell Programming and Scripting
but keep if does not
I have a file: --> my.out
foo: bar
foo: moo
blarg
i am on vacation
foo: goose
foo: lucy
foo: moose
foo: stucky
groover@monkey.org
foo: bozo
grimace@gonzo.net
dear sir - blargo blargo
foo: goon
foo: sloppy
foo: saudi
gimme gimme gimme (3 Replies)
Discussion started by: spacegoose
3 Replies
6. Shell Programming and Scripting
#!/usr/bin/perl
use Shell;
open THEFILE, "C:\galileo_integration.txt" || die "Couldnt open the file!";
@wholeThing = <THEFILE>;
close THEFILE;
foreach $line (@wholeThing){
if ($line =~ m/\\0$/){
@nextThing = $line;
if ($line =~ s/\\0/\\LATEST/g){
@otherThing =... (2 Replies)
Discussion started by: nmattam
2 Replies
7. Shell Programming and Scripting
i have a file in this pattern
MATCH1 word1 IMAGE word3 word4
MATCH2 word1 word2 word3 word4
MATCH2 word1 word2 word3 word4
MATCH2 word1 word2 word3 word4
MATCH2 word1 word2 word3 word4
MATCH1 word1 IMAGE word3 word4
MATCH2 word1 word2 word3 word4
MATCH2 word1 word2 word3 word4
MATCH2 word1... (7 Replies)
Discussion started by: bangaram
7 Replies
8. Shell Programming and Scripting
Hi All,
I would like my code to be able to print out the whole line if 1st field has a dot in the number. Sample input and expected output given below.
My AWK code is below but it can;t work, can any expert help me ?
Thanks in advance.
{if ($1 ~ /*\.*/) { print $0 }}
Input:
... (2 Replies)
Discussion started by: Raynon
2 Replies
9. Shell Programming and Scripting
hi guys,
I want to do pattern matching with awk or sed but I don't know how. here's what I want:
I have a line number for a pattern that I have already found using grep, and I know a pattern like "---" that happens a few lines above that certain line number. I want to print out the chunk... (1 Reply)
Discussion started by: alirezan
1 Replies
10. Shell Programming and Scripting
Hello Dudes,
I have a task to make a unix shell script that should search for a
specific TEXT in a file.If that TEXT is found, shell script should add
a comment statement before that TEXT line.
Ex : LINE 1 xxxxx
LINE 2 xxxx CALL xxxx
LINE 3 xxxx PERFORM UNTIL
if i... (1 Reply)
Discussion started by: kirrushna
1 Replies