10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i have a file hello.log which as several line that look like the below
2015-12-07 09:46:56 0:339 184.108.40.206 POST /helloWorld
2015-12-07 09:46:57 0:439 220.127.116.11 POST /helloWorld
when i grep expecting to see results like the below.
... (6 Replies)
Discussion started by: mohtashims
2. Shell Programming and Scripting
let's say we have input in files test1.txt, test2.txt, text3.txt ... ... ... ('...' means more files & lines not just 'dots')
... (4 Replies)
Discussion started by: msonoth
3. UNIX for Dummies Questions & Answers
Am running the command below to search for files that contains a certain string.
grep -il "shutdown" `find . -type f -mtime -1 -print` | grep "^./scripts/active"
How do I get it to do a ls -l on the list of files? I tried doing ls -l `grep -il "shutdown" `find . -type f -mtime -1... (5 Replies)
Discussion started by: newbie_01
4. Shell Programming and Scripting
I have been looking around but can't find the answer to my problem:
If the grep command displays no results, print "no results have been found" and increment x. But if the grep command find something, do nothing.
echo "no results have been found $x"
x=`expr $x + 1 `... (3 Replies)
Discussion started by: Benou
5. Shell Programming and Scripting
Here is one I am baffled with; I have not used unix for a while and now that I am back it has been fun remembering and I have enjoyed it, for the most past. this is in ksh.
I need to search in a file for the line with X1 and cut columns 20-25, put them into a variable, added them (dollar... (3 Replies)
Discussion started by: CougarMutt
6. UNIX for Dummies Questions & Answers
I am currently reading a tar file and searching for a particular word using grep e.g. Plane. At the moment, if a sentence is found with the word "Plane" the sentence itself is piped to another file.
Here is the code i am using;
for jar in 'cat jar_file.tar'; do
tar -tvf... (3 Replies)
Discussion started by: crunchie
7. Shell Programming and Scripting
I'm struggling with a problem that I'm wondering (and hoping!) that someone can help me with.
I have a number of .xml files which I'm using grep to search for the string 'include'. I need to extract the value of the include from the grep result.
For example, on any given file, I... (2 Replies)
Discussion started by: Steve_altius
8. UNIX for Dummies Questions & Answers
I need to search for matching strings in a database and I want to print out all files that matches in "detail", which means that I want the output to contain datum of last saving. I only get the grep function tp print the actual file names which is not enough since the database is to large... (14 Replies)
Discussion started by: slire
9. Shell Programming and Scripting
I need help to further reduce the output shown below. I want to be able to only return the paragraph where the 'Database alias' is exactly equal to DBIHP. I do not want the other paragraphs being shown below.
$ echo $dbalias
$ db2 list db directory|grep -p 'Database alias ... (2 Replies)
Discussion started by: priceb
10. Shell Programming and Scripting
Perhaps someone here can help with this. I'd like to grep a plain text file for a word and output each line containing a word found to a seperate line instead of back to back.
cat file.txt > grep -i CAT > results.txt
The cat said meow
The... (7 Replies)
Discussion started by: sysera