I am new to unix. i need to know how to use grep to grep and expression from a file. and pass the result as a 0 for found and 1 for not found. I can only go up to grep 'Checking Subscription Status' ranos.log. Please help. Thank you. (2 Replies)
Hi guys,
I have the following grep command in a script to search through a file for a string and return its count, and it works fine for when the string exists:
grep "string" file.txt | wc
However, sometimes the result will be 0 and I want the script to take this as the result. Right now... (6 Replies)
Hi,
I have about 12 columns and 15 rows to be retrived from sybase isql command through unix. But when i output the sql into a file and see it, the formatting is going for a toss. can someone please suggest how can i get the result correctly in the output file ?
Thanks,
Sateesh (2 Replies)
Hi,
My code is like this
if swlist -a revision 2>/dev/null | grep ABC 2>/dev/null
then
echo "Found Above mentioned ABC Version, please remove it first..."
fi
This is displaying the result to the screen.
i want to first suppress that and for that i wrote the below... (1 Reply)
Here is my script so far:
set dirs = ` find . -name "message.jar" 2> /dev/null | cut -d "/" -f 2 ` | uniq
foreach dir ( $dirs )
if (grep $dir/* someText==null) --> how do I write this in script?
print $dir
end
end (4 Replies)
Trying to create a command line script to look for all files matching a pattern, grep for a specific value in each file, and write out the filename long list. It's possible the filename won't containe the value.
{
echo “Running....”
for fname in 811_Intermediate_File_*
do
grep -l... (3 Replies)
Hi
While trying to do a search on solaris, the grep results seems to be appearing on the same line instead of the new line.
Wed Jan 18 14:45:48 weblogic@test:/abcd$ grep qainejb02 *
qa_cluster_biz_view_tc_intl_servers_ports_2:qainejb02 7101
qa_cluster_servers_2:qainejb02... (2 Replies)
Hello.
I want to get all modules which are loaded and which name are exactly 2 characters long and not more than 2 characters and begin with "nv"
lsmod | (e)grep '^nv????????????
I want to get all modules which are loaded and which name begin with "nv" and are 2 to 7 characters long
... (1 Reply)
Hi,
I have a .sh file, to email a report of our backups from a linux machine. It looks like this (minus a few bits):
echo "HELO $host.$domain"
sleep 1
echo "mail from: vdrreport@$domain"
sleep 1
echo "rcpt to:$mailto"
sleep 1
echo "data"
sleep 1
echo "subject: $host VDR-Report... (2 Replies)
Hi,
I am running following command in a bash script for testing IO and use grep to get throughput number, but it did not work, it displayed everything:
dd if=/dev/zero of=/dev/null bs=1G count=1 oflag=dsync | grep bytes | awk '{print $7}'
1+0 records in
1+0 records out
536870912 bytes... (2 Replies)
Discussion started by: hce
2 Replies
LEARN ABOUT DEBIAN
codechanges
codechanges(1) General Commands Manual codechanges(1)NAME
codechanges - computes the amount of code changes between two code trees or single files
SYNOPSIS
codechanges [-n] old-directory new-directory
codechanges [-n] old-file new-file
DESCRIPTION
codechanges recursively compares the two named directories (or files) calculating new/deleted/changed lines, not including comments or
blank lines, in files which appear to be source files (C, C++, shell, and Makefiles). To include comments and blank lines, use the -n
option.
APPLICATIONS
codechanges is purpose designed to measure the amount of code change between milestones in a project's life. The following output is from
two stages, plus some artificial test cases, in the pmccabe code stream:
NEW DELETED CHANGED Old File, New File
11 19 4 old.pmccabe/./Makefile pmccabe/./Makefile
214 10 39 old.pmccabe/./cparse.c pmccabe/./cparse.c
463 0 0 NEWFILE pmccabe/./decomment.c
147 4 39 old.pmccabe/./dmain.c pmccabe/./dmain.c
10 0 0 NEWFILE pmccabe/./dmain.h
407 0 0 NEWFILE pmccabe/./getopt.c
48 0 0 NEWFILE pmccabe/./getopt.h
9 18 12 old.pmccabe/./gettoken.c pmccabe/./gettoken.c
18 18 15 old.pmccabe/./io.c pmccabe/./io.c
175 43 20 old.pmccabe/./nmain.c pmccabe/./nmain.c
194 11 22 old.pmccabe/./pmccabe.c pmccabe/./pmccabe.c
42 0 20 old.pmccabe/./pmccabe.h pmccabe/./pmccabe.h
0 1318 0 old.pmccabe/./test/langMode.c DELETED
24 0 0 NEWFILE pmccabe/./test006/Grapher.H
620 0 0 NEWFILE pmccabe/./test006/Handler.H
442 0 0 NEWFILE pmccabe/./test006/NodeArc.H
764 0 0 NEWFILE pmccabe/./w/parser.C
95 0 0 NEWFILE pmccabe/./w/tokens.h
4 0 0 NEWFILE pmccabe/./x.sh
3687 1441 171 TOTAL
DIAGNOSTICS
There aren't many at this time.
BUGS
codechanges thinks it knows what source files are interesting and the user may not agree with its choices. It's a script and should be
easy to modify. Ultimately this should probably be configurable.
codechanges uses a program called decomment which guesses how to de-comment a file based on its file name and it's not always perfect.
AUTHOR
Paul Bame
SEE ALSO pmccabe(1), decomment(1)HP 12Feb2003 codechanges(1)