10-14-2008
Thanks. I am trying to see what happens here:
perl: this is obvious
-pi.bak: simply copy the current file to it's name + .bak?
-e: there is no mention of this in man perl.
'BEGIN { $/=""; } s/\n //gm': the actual regex. I don't quite get it
*.vcard: go through all these files?
I actually need to change the regex so that it not only removes the space at the beginning of a line, but removes the newline character as well. The only newline characters that should remain are those not followed by a space. In php that would be str_replace("\n ", "", $string); however I cannot figure out the perl regex to modify it as such. And regexes are hard to google for!
I do appreciate the code example, but I am also trying to learn a bit (unusual, I know). I very much appreciate your assistance and patience.
8 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I downloaded some applications from CD on a windows2000 PC to a Unix Sco machine using the WS-FTP program.
When I tried to run the applications on the Unix machines I got an error. The files must have been corrupted in the process of transferring files from a Windows 2000 to a Unix Sco... (9 Replies)
Discussion started by: BAM
9 Replies
2. UNIX for Dummies Questions & Answers
I've got a backuptape in cpio format that was accidentally overwritten with a very small batch file. As I assume that the cpio header has been overwritten, I cannot extract files from the backup in the conventional manner:
( cpio -itv </dev/rct0
cpio: this is not a cpio file, bad header)
... (0 Replies)
Discussion started by: mart4179
0 Replies
3. Linux
I am trying to replace the value of $f3 but its not working . I don't know what I am missing here .
cat dim_copy.20080516.sql | grep -i "create view" | grep -v OPSDM002 | while read f1 f2 f3 f4 f5 f6 f7 f8 f9
do
echo " $f3 "
sed -e... (13 Replies)
Discussion started by: capri_drm
13 Replies
4. Solaris
I was installing sfw sudo and its dependencies (libiconv, libintl, libgcc)on Solaris 10, running on an x86 x4200 and I corrupted some PAM library files. It's a standard Solaris 10 base install, with some added software & libraries from a vendor.
I am on console trying to get root access back,... (1 Reply)
Discussion started by: Mariognarly
1 Replies
5. HP-UX
In my Windows 2003 server machine I have a winrar or winzip file that i around 3GB.
This zip/rar file is ftped to a unix mahine (HPUX) . FTP is successful. But when it get this file to check if its has been ftped correctly, the file is corrupted.
Is there something wrong that i am doing while... (4 Replies)
Discussion started by: maroli
4 Replies
6. Shell Programming and Scripting
Hi everyone,
Please help on this:
I have file1:
<file title="Title 1 and 2">
<report>
<title>Title 1</title>
<number>No. 1234</number>
<address>Address 1</address>
<date>October 07, 2009</date>
<description>Some text</description>
</report>
... (6 Replies)
Discussion started by: Ophiuchus
6 Replies
7. Shell Programming and Scripting
awk "BEGIN {if($MessageREAD<$ThresholdW)
{print \"OK\" ; exit 0}
else if(($MessageREAD>=$ThresholdW) && ($MessageREAD<$ThresholdC))
{print \"WARNING\" ; exit 1}"
else if($MessageREAD<=$ThresholdC)
{print \"CRITICAL\" ;... (4 Replies)
Discussion started by: SkySmart
4 Replies
8. Hardware
$ uname -a
Linux darksun 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:45 UTC 2014 i686 athlon i686 GNU/Linux
My files are getting corrupted on a frequent basis.
$ sudo fdisk -l /dev/sda
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total... (10 Replies)
Discussion started by: rlopes
10 Replies
LEARN ABOUT LINUX
re_exec
RE_COMP(3) Linux Programmer's Manual RE_COMP(3)
NAME
re_comp, re_exec - BSD regex functions
SYNOPSIS
#define _REGEX_RE_COMP
#include <sys/types.h>
#include <regex.h>
char *re_comp(char *regex);
int re_exec(char *string);
DESCRIPTION
re_comp() is used to compile the null-terminated regular expression pointed to by regex. The compiled pattern occupies a static area, the
pattern buffer, which is overwritten by subsequent use of re_comp(). If regex is NULL, no operation is performed and the pattern buffer's
contents are not altered.
re_exec() is used to assess whether the null-terminated string pointed to by string matches the previously compiled regex.
RETURN VALUE
re_comp() returns NULL on successful compilation of regex otherwise it returns a pointer to an appropriate error message.
re_exec() returns 1 for a successful match, zero for failure.
CONFORMING TO
4.3BSD.
NOTES
These functions are obsolete; the functions documented in regcomp(3) should be used instead.
SEE ALSO
regcomp(3), regex(7), GNU regex manual
COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU
1995-07-14 RE_COMP(3)