How to apply a patch?
Answer:
In the last post, you know how to create a patch for two folders.
But, how to use the patch?
See below.
# cp -r foo dummy
# cd dummy
# patch -p1 -i ../bar.patch
Now the folder dummy is the same as bar.
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to apply a patch?
Answer:
In the last post, you know how to create a patch for two folders.
But, how to use the patch?
See below.
# cp -r foo dummy
# cd dummy
# patch -p1 -i ../bar.patch
Now the folder dummy is the same as bar.
Replace Unicode character using regex with Perl
Answer:
To use regex to replace Perl's Unicode string, you can try the following.
$text =~ s/[\x{0000}-\x{007F}]+/ /g;
The above code replace all Unicode with codepoint from 0 to 127 by a space.
Multi-line string in PHP
Answer:
To assign a multi-line string to a variable, is easy with the Heredoc
E.g.
<?php
$text = <<<EOT
<p>
this "is" a 'test'
</p>
EOT;
echo $text;
Multiline string in Perl
Answer:
You can either use the q operators.
my $s = q#''''"
test
"""'
#;
print $s;
Or qq operators if you need interpolation.
my $d = "test";
my $s = qq#''''"
$d
"""'
#;
print $s;
Creating a simple tag in SVN
Answer:
In SVN, a tag is a “snapshot” of a project in time. By creating a tag of a project, this allow you to easily reference a particular version sometimes later.
To create a tag, use svn copy:
# svn copy http://example.com/svn/repos/demo/trunk \
http://example.com/svn/repos/demo/tags/release-1.0.0 \
-m "Tagging the 1.0.0 release of the 'demo' project."
Committed revision 124.