If your grep does not have -o etc. and this is regarding to your former post https://www.unix.com/shell-programmin...g-problem.html, you can also just slightly modify the line I already gave in the there to get only the matches in the files, not the complete files as output:
hello
have a file1
H87I
Y788O
T347U
J23U
and
file2 J23U U887Y I99U T556U
file3 I99O J99T F557J
file4 N99I T666U R55Y
file5 H87I T347U
file6 H77U R556Y E44T
file7 Y788O K98U H8I
May be using script we can use file1 to search for all the files
and have the output
H87I file5... (3 Replies)
Hello,
I have a file which has user information. Each user has 2 variables with the same name like
Email: testuser1
Email: testuser1@test.com
Email: testuser2
Email: testuser2@test.com
My intention is to delete the ones without the '@' symbol. When I run this statement awk '/^Email:/&&!/@/'... (6 Replies)
Hi,
Is there anyway to print contents of any file ( say log files that grow automatically) within some timeframe ( comparing with current time), say
print contents of the added in:
1) last 2 hr
2) last 45 min
3) last 3 hrs 47 min (3 Replies)
i am trying to search a few hundred release note text files for a certain word. however when i use the below command i can find a file that contains it but i dont know the file name. how can i change this command to output the name of the file that grep was successful in?
find builds -name... (4 Replies)
Hi,
Need help in writing a script to read the contents of this file test
Test
00a
00b
00c
00d
00e
00f
where it need to read each line to give a display such as
form meta from dev 00a , config=Striped; add dev 00b:00f to meta 00a
Can any one help me in writing this script (2 Replies)
Solaris 10
When running grep from within find command (don't know the technical term for 'running from within' ) , find command returns only the line which contains the pattern. Is there any way to get the file name printed as well ?
$ pwd
/opt/testdir/anotherDir
$
$
$ cat findme.txt... (3 Replies)
Hi Friends,
This is the only solution to my task. So, any help is highly appreciated.
I have a file
cat input1.bed
chr1 100 200 abc
chr1 120 300 def
chr1 145 226 ghi
chr2 567 600 unix
Now, I have another file by name
input2.bed (This file is a binary file not readable by the... (7 Replies)
Hello,
I know that gnu grep has option of -A and -B to extra previous and next lines.
But I'm using HP UX and its grep does not support these options.
BID="0/0/6/1/1.145.17.255.0.0.0"
I need to search a file using $BID and get next 5 lines and previous 5 lines separately.
Please... (1 Reply)
I need to find a file and print its contents
I am trying but it is not working
find -path /opt/app-root/src/.npm/_logs -type f -name "*.log" -print
Version
$ bash -version
GNU bash, version 4.4.12(1)-release (x86_64-pc-msys) (1 Reply)
Discussion started by: SVRao19056
1 Replies
LEARN ABOUT DEBIAN
affcat
AFCAT(1) General Commands Manual AFCAT(1)NAME
afcat - Output contents of an image file to stdout.
SYNOPSIS
afcat [options] image [images]
DESCRIPTION
affcat outputs the contents of an image file to stdout. Image files that are not raw but are recognized by AFF will be output in raw for-
mat. Missing pages will not be padded, but the fact that they are missing will be noted on STDERR.
The options are as follows:
-s name
Output the named segment, instead of the image data. This is a way to output metadata.
-p nnn Just output page number nnn
-S nnn Just output data sector number nnn. Sector #0 is the first sector.
-q Quiet mode. Don't print to STDERR if a page is skipped because it is not present.
-n Noisy mode. Tell when pages are skipped.
-l List all the segment names, rather than outputing data.
-L List Long. Prints segment names, lengths, and args.
-d Debug mode. Print the page numbers to stderr as data goes to stdout.
-b Output BADFALG for bad blocks (default is to output NULLs).
-v Just print the version number and exit.
-r offset:count
Seek to the given byte offset and output count characters in each file; may be repeated.
HISTORY
afcat first appeared in AFFLIB v1.00.
AUTHOR
Simson Garfinkel <simsong@acm.org>
User Manuals OCT 2008 AFCAT(1)