HI again, still working on the assignment, which is really hard given we just started unix 4 weeks ago. This script should change the permission for the user depending if its x, w or r, to the opposite. When i try to run it, I am getting expression error. Can you spot where the problem is? I really... (3 Replies)
Hi
what's the correct way of writing if
1)if "$time_diff" -gt 5
then
echo "killing hung process \n"
fi
2)if test $time_diff -gt 5
then
echo "killing hung process \n"
fi
where -time_diff=$(($Sam - $current_min))
and current_min=`date +%M`
infact both are giving Syntax... (1 Reply)
Hello,
This is my first post so, Hello World! Anyways, I'm learning how to use unix and its quickly become apparent that a strong foundation in regular expressions will make things easier. I'm not sure if my syntax is messing things up or my logic is messing things up.
ps -e | grep... (4 Replies)
Hello,
I'm working on learning regular expressions and what I can do with them. I'm using unix to and its programs to experiment and learn what my limitations are with them.
I'm working on duplicating the regular expression:
^(.*)(\r?\n\1)+$
This is supposed to delete duplicate lines... (2 Replies)
#! /bin/csh
set umr=UMR
foreach i ( `ls`)
set file_nm=$i
set bh_nm=`echo $file_nm | cut -d"_" -f2`
if($bh_nm !=$umr) then
{
set bh_ext=`echo $file_nm | cut -d"_" -f4`
set bh_num_nm="$bh_nm $bh_ext a .txt"
mv $file_nm $bh_num_nm
}
... (1 Reply)
Hello,
I am relatively new to UNIX scripting and am learning a lot. I have already tried several searches on this website and have tried various syntax options suggested to no avail. I am obviously not writing the script correctly. I really do appreciate any and all the help.
Below is an... (8 Replies)
I'm pretty new to shell scripting, but I am catching on quick. I did see one of the stickied threads about the csh, and I think this is relevant, but I don't understand enough to make a decision based on it. So as you'll see below, I use the |csh pipe, and if that is not correct, I'm certainly... (2 Replies)
Hello there!
I am having some difficulties in the syntax of a script.
I am a newbie :)
What i want is a script that copies 1 or more files to a destination folder with
a question if file allready exists
if ($#argv > 2) then
if (-d $argv($#argv)) then
foreach x ($*)
cp -i $x to... (4 Replies)
I've found this script which seems very promising to solve my issue:
To search and replace many different database passwords in many different (.php, .pl, .cgi, etc.) files across my filesystem.
The passwords may or may not be contained within quotes, single quotes, etc.
#!/bin/bash... (4 Replies)
I'm using tcl scripts in ns2 ( network simulator) through cygwin. It works fine , however, I downloaded an example when i run it , I got the following syntax error:
syntax error in expression with " *2" : unexpected operator *
while executing :
"expr $bw *2"
invoked from within:
"$ns... (1 Reply)
Discussion started by: ENG_MOHD
1 Replies
LEARN ABOUT SUSE
grepdiff
GREPDIFF(1) Man pages GREPDIFF(1)NAME
grepdiff - show files modified by a diff containing a regex
SYNOPSIS
grepdiff [[-n] | [--line-number]] [--number-files] [[-p n] | [--strip-match=n]] [--strip=n] [--addprefix=PREFIX] [[-s] | [--status]]
[[-i PATTERN] | [--include=PATTERN]] [[-x PATTERN] | [--exclude=PATTERN]] [[-v] | [--verbose]] [[-E] | [--extended-regexp]] [[-H]
| [--with-filename]] [[-h] | [--no-filename]] [--output-matching=WHAT] {[REGEX] | [-f FILE]} [file...]
grepdiff {[--help] | [--version] | [--list] | [--filter ...]}
DESCRIPTION
For each file modified by a patch, if the patch hunk contains the REGEX then the file's name is printed.
The regular expression is treated as POSIX Basic Regular Expression syntax, unless the -E option is given in which case POSIX Extended
Regular Expression syntax is used.
For example, to see the patches in my.patch which contain the regular expression "pf_gfp_mask", use:
grepdiff pf_gfp_mask my.patch |
xargs -rn1 filterdiff my.patch -i
You can use both unified and context format diffs with this program.
OPTIONS -n, --line-number
Display the line number that each patch begins at. If verbose output is requested, each matching hunk is listed as well.
For a description of the output format see lsdiff(1).
--number-files
File numbers are listed, beginning at 1, before each filename.
-p n, --strip-match=n
When matching, ignore the first n components of the pathname.
--strip=n
Remove the first n components of the pathname before displaying it.
--addprefix=PREFIX
Prefix the pathname with PREFIX before displaying it.
-s
Show file additions, modifications and removals. A file addition is indicated by a "+", a removal by a "-", and a modification by a
"!".
-i PATTERN, --include=PATTERN
Include only files matching PATTERN.
-x PATTERN --exclude=PATTERN
Exclude files matching PATTERN.
-E, --extended-regexp
Use POSIX Extended Regular Expression syntax.
-H, --with-filename
Print the name of the patch file containing each match.
-h, --no-filename
Suppress the name of the patch file containing each match.
-f FILE, --file=FILE
Read regular expressions from FILE, one per line.
--output-matching=hunk|file
Display the matching hunk-level or file-level diffs.
--help
Display a short usage message.
--version
Display the version number of grepdiff.
--filter
Behave like filterdiff(1) instead.
--list
Behave like lsdiff(1) instead.
SEE ALSO filterdiff(1), lsdiff(1)AUTHOR
Tim Waugh <twaugh@redhat.com>
Package maintainer
patchutils 23 Jan 2009 GREPDIFF(1)