Search Results

Search: Posts Made By: jboy
4,273
Posted By jboy
Thanks guys, But I would like to do it with grep...
Thanks guys, But I would like to do it with grep only no awk. I tried another code shown below and I got an error saying that " line 2: a: command not found"


#!/bin/bash
a = `grep -q -w $1...
4,273
Posted By jboy
Bash - Same frequency
Hi,

Could anyone help me with the following question, if I have two colums (names and frequency) as follows in a file called name.txt


Michael 1
Jones 1
Ben 2
Rebeca 4
David 1

and I...
102,619
Posted By jboy
Ok, here is what the question is asking: Create...
Ok, here is what the question is asking:
Create a file called "filename.txt" containing, IN THE ORIGINAL ORDER, only the lines of

/usr/local/names.txt

starting with the string 'BAT' or 'SAT'....
102,619
Posted By jboy
Thanks for the swift reply. It works perfectly...
Thanks for the swift reply. It works perfectly fine with egrep but is there a way that I can actually do it with grep because I want to copy the lines of a file in the ORGINAL ORDER to another file?...
102,619
Posted By jboy
How to search for string A OR string B using Grep?
Hi,

This is what I have done so far which is wrong for some reason:

grep -h "stringA | stringB" filename

Thank in advance!
7,066
Posted By jboy
Hey, I don't know why your code didn't work the...
Hey, I don't know why your code didn't work the first time..But it is working now.
Thanks for your help.
7,066
Posted By jboy
I tried this but I still get no correct output......
I tried this but I still get no correct output...



a=`grep ^$2 $1`
echo $a


so I tried the following way but the results are displayed in one line, if I have a file with multiple...
7,066
Posted By jboy
Yes, here is what I have tried inside the script...
Yes, here is what I have tried inside the script file but it does not work:



thanks.
7,066
Posted By jboy
Thanks, but this doesn't work without using echo...
Thanks, but this doesn't work without using echo command inside the script file and I don't know how to make it work.
7,066
Posted By jboy
Bash script - Grep
Hi,

I am very new to bash scripting and I need to write a bash script that takes two arguments, a string and a file. The output should be each line which matches the string *from the beginning of...
Showing results 1 to 10 of 10

 
All times are GMT -4. The time now is 03:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy