10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Lets say I have a massive directory which is filled with other directories all filled with different c++ scripts and I want a listing of all the scripts that contain the string: "this string". Is there a way to use a grep search for that? I tried:
grep -lr "this string" *
but I do not... (3 Replies)
Discussion started by: Circuits
3 Replies
2. Shell Programming and Scripting
Hello,
What I wish to attain is:
- to read fileA line by line
- search entire line as string in fileB
- when found, grep the next line in fileB
- then merge "searched line" and "found line" in a new file, fileC
Here is my fileA:
T S Eliot
J L Borges
L Aragon
L L Aragon
T S Eliot 4 0... (17 Replies)
Discussion started by: baris35
17 Replies
3. Shell Programming and Scripting
Hello!
I have a sample code in which a grep is being performed from multiple files with a date format in their naming convention. Here the script:
#! /usr/bin/bash
cd /IN/service_packages/SMS/cdr/received
MYDATE=`date +"%Y%m%d%H%M"`
#get the value then divide by 60
#DAPS_SLC01... (3 Replies)
Discussion started by: nms
3 Replies
4. Shell Programming and Scripting
I have the following code:
# Get the line of stations_info.txt starting with "${xstation1} " and copy it to file temp.txt
grep "^${xstation1} " stations_info.txt > temp.txt
# Get lat and long of station
nl=0
... (2 Replies)
Discussion started by: claire.a
2 Replies
5. Shell Programming and Scripting
Need assistance in writing a for loop script or any looping method. Below is the code where i can get all the files from the URL . There are about 80 files in the URL .Every day the files get updated . Script that i wanted is the loop must keep on running till it gets 80 files. It matches the count... (5 Replies)
Discussion started by: ajayram_arya
5 Replies
6. Shell Programming and Scripting
Hi,
I have got the below requirement. please suggest.
I have a file like,
Processing Item is:
/data/ing/cfg2/abc.txt
/data/ing/cfg3/bgc.txt
Processing Item is:
/data/cmd/for2/ght.txt
/data/kernal/config.klgt.txt
I want to process the above file to get the output file like,
... (5 Replies)
Discussion started by: rbalaj16
5 Replies
7. Shell Programming and Scripting
Hi
Can any one pls tell me how to grep this line
POPULATION,69691,20120509
I want the number 69691 from the above line.
How to grep from the first comma till the next comma.
Thank You.:confused: (8 Replies)
Discussion started by: rxg
8 Replies
8. Shell Programming and Scripting
Hi Folks,
I got to know from this forums on how to grep from a particular line say line 6
awk 'NR==6 {print;exit}'
But how do i grep from line 6 till the end of the file or command output.
Thanks, (3 Replies)
Discussion started by: Mr. Zer0
3 Replies
9. Shell Programming and Scripting
Dear All
I have a file like this
112534554
446538656
444695656
225696966
226569744
228787874
113536566
443533535
222564552
115464656
225445345
225533234
I want to cut the file into different parts where the first two columns are '11' . The first two columns will be either... (3 Replies)
Discussion started by: anoopvraj
3 Replies
10. UNIX for Dummies Questions & Answers
Guys - I am new to Unix scripting and am in need for a script that does the following. I have bits and pieces created and tested but i am just having a little difficult time getting it all together.
- Loop through till it finds a string in a specific file.
Any help is greatly appreciated.
... (1 Reply)
Discussion started by: mrehman
1 Replies