07-22-2009
hmm.. can you just use backlash? forward slashes complicate things
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
why i can't use this command:
echo $arg | cut -c 1,2 | read remainArg or
echo $arg | cut -c 1,2 | read $remainArg
so that the result will be assign to remainArg.
Anyway to do this? :) (1 Reply)
Discussion started by: AkumaTay
1 Replies
2. Shell Programming and Scripting
I have to assign a result of a query to a vairable like this
how can i do this
Query = select count(*) from table
x=`db2 ${Query}| sed -n '4p'`
but this doesn't work, is there any other way to assign the result without redirecting the result to temp file. .
Thanks
Mark. (3 Replies)
Discussion started by: markjason
3 Replies
3. Shell Programming and Scripting
I have a list of names in a file.
i want to assign those names to a variable in such a manner
eg:
$cat file.txt
pete
lisa
john
var=pete-lisa-john
how do i do this in shell scripting? (10 Replies)
Discussion started by: Shivdatta
10 Replies
4. Shell Programming and Scripting
bash-3.00$ /usr/bin/netstat -an -f inet | awk -F' ' '{if ($1$4 == "tcp*.21")print $5}'
*.*
bash-3.00$ A=` /usr/bin/netstat -an -f inet | awk -F' ' '{if ($1$4 == "tcp*.21")print $5}'`
bash-3.00$ echo $A
db2_lastdone.bkp
As you can see ,after running command i get *.* in return but the same... (5 Replies)
Discussion started by: ak835
5 Replies
5. Shell Programming and Scripting
Dear All,
we have a command output which looks like :
Total 200 queues in 30000 Kbytes
and we're going to get "200" and "30000" for further process. currently, i'm using :
numA=echo $OUTPUT | awk '{print $2}'
numB=echo $OUTPUT | awk '{print $5}'
my question is : can I use just one... (4 Replies)
Discussion started by: tiger2000
4 Replies
6. Shell Programming and Scripting
How can I assign a variable to an variable. IE $car=honda
One way I can do it is export $car=honda
or
let $car=2323
Is there any other ways to preform this task (3 Replies)
Discussion started by: 3junior
3 Replies
7. Shell Programming and Scripting
I launch 'netstat -a', if string 'ESTABLISHED' found, then VAR=1
#!/bin/bash
VAR=0;
netstat -a | awk '$6 ~ /ESTABLISHED/ {VAR=1}'
I cannot find the right syntax.
thanx guys! (3 Replies)
Discussion started by: arpagon
3 Replies
8. UNIX for Beginners Questions & Answers
Hello All,
Hope you're doing well !
I am trying below command to be passed in a shell script, header_date_14 is a variable and $1 is the name of a file I intend to pass as a command line argument, however command line argument is not being accepted.
header_date_14=$(m_dump... (8 Replies)
Discussion started by: ektubbe
8 Replies
9. UNIX for Beginners Questions & Answers
I have the following script, and I want to assign the output ($10 and $5) from awk to N and L:
grdinfo data.grd | awk '{print $10,$5}'| read N L
output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use... (8 Replies)
Discussion started by: geomarine
8 Replies
10. UNIX for Beginners Questions & Answers
Hi Guys,
I need to assign the value of which has rows to a variable, Can you advise how to do that
hive --orcfiledump /hdfs_path/ | grep "Rows"
Rows: 131554
I need to assign this row count itself to a unix variable
count=$(hive --orcfiledump /hdfs_path/ | grep "Rows")
Expected ... (6 Replies)
Discussion started by: Master_Mind
6 Replies
SVN_DIFF(3) 1 SVN_DIFF(3)
svn_diff - Recursively diffs two paths
SYNOPSIS
array svn_diff (string $path1, int $rev1, string $path2, int $rev2)
DESCRIPTION
Recursively diffs two paths, $path1 and $path2.
Note
This is not a general-purpose diff utility. Only local files that are versioned may be diffed: other files will fail.
PARAMETERS
o $path1
- First path to diff. This can be a URL to a file/directory in an SVN repository or a local file/directory path.
Note
Relative paths will be resolved as if the current working directory was the one that contains the PHP binary. To use the
calling script's working directory, use realpath(3) or dirname(__FILE__).
Warning
If a local file path has only backslashes and no forward slashes, this extension will fail to find the path. Always replace
all backslashes with forward slashes when using this function.
o $rev1
- First path's revision number. Use SVN_REVISION_HEAD to specify the most recent revision.
o $path2
- Second path to diff. See $path1 for description.
o $rev2
- Second path's revision number. See $rev1 for description.
RETURN VALUES
Returns an array-list consisting of two streams: the first is the diff output and the second contains error stream output. The streams can
be read using fread(3). Returns FALSE or NULL on error.
The diff output will, by default, be in the form of Subversion's custom unified diff format, but an external diff engine may be used
depending on Subversion's configuration.
NOTES
Warning
This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in
a future release of PHP. This function should be used at your own risk.
EXAMPLES
Example #1
Basic example
This example demonstrates the basic usage of this function, and the retrieval of contents from the stream:
<?php
list($diff, $errors) = svn_diff(
'http://www.example.com/svnroot/trunk/foo', SVN_REVISION_HEAD,
'http://www.example.com/svnroot/branches/dev/foo', SVN_REVISION_HEAD
);
if (!$diff) exit;
$contents = '';
while (!feof($diff)) {
$contents .= fread($diff, 8192);
}
fclose($diff);
fclose($errors);
var_dump($contents);
?>
The above example will output:
Index: http://www.example.com/svnroot/trunk/foo
===================================================================
--- http://www.example.com/svnroot/trunk/foo (.../foo) (revision 23)
+++ http://www.example.com/svnroot/branches/dev/foo (.../foo) (revision 27)
// further diff output
Example #2
Diffing two revisions of a repository path
This example implements a wrapper function that allows a user to easily diff two revisions of the same item using an external
repository path (the default syntax is somewhat verbose):
<?php
function svn_diff_same_item($path, $rev1, $rev2) {
return svn_diff($path, $rev1, $path, $rev2);
}
?>
Example #3
Portably diffing two local files
This example implements a wrapper function that portably diffs two local files, compensating for the realpath(3) fix and the back-
slashes bug:
<?php
function svn_diff_local($path1, $rev1, $path2, $rev2) {
$path1 = str_replace('\', '/', realpath($path1));
$path2 = str_replace('\', '/', realpath($path2));
return svn_diff($path1, $rev1, $path2, $rev2);
}
?>
SEE ALSO
SVN documentation on svn diff.
PHP Documentation Group SVN_DIFF(3)