04-19-2010
Search for string in filename, not file content
How can I search for a string in a filename? For example, I want to know if a filename (not the file contents) contains the string "test".
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
:confused: There is a flat file on my system which contains email addreses of people in my company. This file is utilized when sending notifications for various things. However nobody knows where this file is located or what it is named. The only thing we know is the email address of a user who... (4 Replies)
Discussion started by: kollerj
4 Replies
2. Shell Programming and Scripting
Dear Experts,
Please help to teach me how to add the filename into the file content.
Actually the file name are EVENTS-20050912.
***************New output that I want***************
EVENTS-20050912 03:33:37 ALARM: BTSSPAN-277-1 30-18013
EVENTS-20050912 12:10:28 ALARM: BTSSPAN-297-2... (1 Reply)
Discussion started by: missutoomuch
1 Replies
3. Shell Programming and Scripting
Hi,
I've a shell script e.g.
#!/bin/bash
echo "Enter the next hop id"
read nhid
echo "enter the IP address"
read IP
echo "enter the interface name"
read name
echo "enter the enable/disable state"
read state
exit 0
now from this script i want to search strings in another (.cam)
... (6 Replies)
Discussion started by: vic_mnnit
6 Replies
4. Shell Programming and Scripting
Hi i want to write a script that will search a filename e.g. test06abc.txt for a string and if it contains this string then set a variable equal to something:
something like:
var1=0
search <filename> for 06
if it contains 06 then
var1=1
else
var1=0
end if
but in unix script :) (4 Replies)
Discussion started by: tuathan
4 Replies
5. Shell Programming and Scripting
Hi All,
How do I search first string & second string and copy all content between them from one file to another file?
Please help me..
Thanks In Advance.
Regards,
Pankaj (12 Replies)
Discussion started by: pankajp
12 Replies
6. Shell Programming and Scripting
I am attempting to grep an exact string from a series of files within a directory and append that output to the filename when it is present in the file. I've been after this all day with no luck. Thanks for your help in advance :wall:. (4 Replies)
Discussion started by: JC_1
4 Replies
7. Shell Programming and Scripting
Hi,
Need your help for this scripting issue I have. I am not really good at this, so seeking your help.
I have a file looking similar to this:
Hello, i am human and name=ABCD.
How are you?
Hello, i am human and name=PQRS.
I am good.
Hello, i am human and name=ABCD.
Good bye.
Hello, i... (12 Replies)
Discussion started by: royzlife
12 Replies
8. UNIX for Dummies Questions & Answers
This should recursively walk through all dirictories and
search for a specified string in all present files, if found
output manicured content (eg some regex) with CAT into
a specified directory (eg /tmp/)
one by one, keeping the original names
This is what I have so far, which seems to... (1 Reply)
Discussion started by: lowmaster
1 Replies
9. Shell Programming and Scripting
Hello,
Is possibly there a way to prepend the filename to its content without a third file? The reason is to add a header to each file contents to distinguish each other when they are pasted side-by-side.
sample.txt:
XLOC_001 0
XLOC_002 23
XLOC_003 4
XLOC_012 6output (with the same... (4 Replies)
Discussion started by: yifangt
4 Replies
LEARN ABOUT DEBIAN
gendesc
gendesc(1) User Manuals gendesc(1)
NAME
gendesc - Generate a test case description file
SYNOPSIS
gendesc [-h|--help] [-v|--version]
[-o|--output-filename filename]
inputfile
DESCRIPTION
Convert plain text test case descriptions into a format as understood by genhtml. inputfile needs to observe the following format:
For each test case:
- one line containing the test case name beginning at the start of the line
- one or more lines containing the test case description indented with at least one whitespace character (tab or space)
Example input file:
test01
An example test case description.
Description continued
test42
Supposedly the answer to most of your questions
Note: valid test names can consist of letters, decimal digits and the underscore character ('_').
OPTIONS
-h
--help
Print a short help text, then exit.
-v
--version
Print version number, then exit.
-o filename
--output-filename filename
Write description data to filename.
By default, output is written to STDOUT.
AUTHOR
Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
SEE ALSO
lcov(1), genhtml(1), geninfo(1), genpng(1), gcov(1)
2010-08-06 LCOV 1.9 gendesc(1)