04-03-2008
Solution: Remove last character from a string
Thanks for taking time to reply and seeing this post.
Following regexps worked best
#removes the last character from all the words of a string
(s/\w\b/ /) )
# replace last number (if it exists) with a space in macro var value
s/\d+\b/ / ;
# removes duplicate words if they exist
s/\s*(\w+\s+)\1/ /) ) ;
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello Experts,
Can someone help me here:
I have a variable which contains a string with "".
set var1 {a}
set str1 {a is the element i want to match}
Now "regexp $var1 $str1" does not work?
("regexp {a\} $str1" works, but var1 gets it's value automatically from another script)
Is... (6 Replies)
Discussion started by: sumitgarg
6 Replies
2. Shell Programming and Scripting
Hello, i'm unable to remove the parenthesis character.
With $parsed_AsciiName =~ s/\(//;
the string is the same
And with $parsed_AsciiName =~ s/(//;
i retrieve "Unmatched ( in regex; marked by <-- HERE in m/( <-- HERE"
Any ideas, please? thank you in advanced. (4 Replies)
Discussion started by: aristegui
4 Replies
3. Shell Programming and Scripting
i want to split the input by a space and remove specific characters like full stop, comma...... etc. and then save each word in an array.
i got something below, but it didn't work. can anyone please help me?
Thank you
#!/usr/bin/perl -w
while (<>)
{
$line = <>;
@word = split(' ',... (6 Replies)
Discussion started by: mingming88
6 Replies
4. Shell Programming and Scripting
Hi,
I wonder if its possible to do the following task using rename (perl v5.8.8).
I want to find filenames matching the specific pattern and then change chosen character of this pattern to a given character, e.g. do the following renaming:
regexp: 'ab' -----> 'a0b'
What's the simplest... (0 Replies)
Discussion started by: pms
0 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am learning reg exp a bit :)
Meta char info:
{n,m} Matches the preceding character at least n times but not more than m times, for example, 'ba{2,3}b' will find 'baab' and 'baaab' but NOT 'bab' or 'baaaab'. Values are enclosed in braces (curly brackets).
Input file:
112
11112... (2 Replies)
Discussion started by: dragon.1431
2 Replies
6. Shell Programming and Scripting
I'd like to remove (do a pattern or precise replacement - this I can handle in SED using Regex )
---AFTER THE 1ST Occurrence ( i.e. on the 2nd occurrence - from the 2nd to fourth occurance ) of a specific string : type 1
-- After the 1st occurrence of 1 string1 till the 1st occurrence of... (4 Replies)
Discussion started by: sieger007
4 Replies
7. Shell Programming and Scripting
In a 10-50GB file , at end of file there is Control-z character
tried the below options,
1. perl -p -i -e 's/^Z//g' new.txt
2. perl -0777lwi -032e0 new.txt
and Sed command, dos2unix etc
it takes more time to remove the control-z. need a command or perl program to GO TO LAST LINE OF FILE ... (7 Replies)
Discussion started by: prsam
7 Replies
8. Shell Programming and Scripting
I'm probably just not thinking of the correct term to search for :-) But I want to match a pattern that might be 'ABC' or '1ABC' there might be three characters, or there might be four, but if there are four, the first has to be 1 (1 Reply)
Discussion started by: jnojr
1 Replies
9. Shell Programming and Scripting
Hi all,
I am trying to filter out those lines that contain a "non-alpha" character.
An example of my input is the following:
zygnematales grb
zygocactus grb
zygocactus_truncatus plt
zygodactyl_foot prt
zygoma prt
zygomatic prt
zygomatic_arch prt
zygomatic_bone ... (2 Replies)
Discussion started by: owwow14
2 Replies
10. Shell Programming and Scripting
Hi all,
I need to remove DBPATH= and /db from the string below using awk (or sed, as it also exists on the machine).
Input: DBPATH=/some/path/database/db
Desired output: /some/path/database
Thank you! (8 Replies)
Discussion started by: ejianu
8 Replies
MFI(4) BSD Kernel Interfaces Manual MFI(4)
NAME
mfi -- LSI MegaRAID SAS driver
SYNOPSIS
To compile this driver into the kernel, place the following lines in your kernel configuration file:
device pci
device mfi
Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5):
mfi_load="YES"
DESCRIPTION
This driver is for LSI's next generation PCI Express SAS RAID controllers. Access to RAID arrays (logical disks) from this driver is pro-
vided via /dev/mfid? device nodes. A simple management interface is also provided on a per-controller basis via the /dev/mfi? device node.
The mfi name is derived from the phrase "MegaRAID Firmware Interface", which is substantially different than the old "MegaRAID" interface and
thus requires a new driver. Older SCSI and SATA MegaRAID cards are supported by amr(4) and will not work with this driver.
Two sysctls are provided to tune the mfi driver's behavior when a request is made to remove a mounted volume. By default the driver will
disallow any requests to remove a mounted volume. If the sysctl dev.mfi.%d.delete_busy_volumes is set to 1, then the driver will allow
mounted volumes to be removed.
HARDWARE
The mfi driver supports the following hardware:
o LSI MegaRAID SAS 1078
o LSI MegaRAID SAS 8408E
o LSI MegaRAID SAS 8480E
o LSI MegaRAID SAS 9260
o Dell PERC5
o Dell PERC6
o IBM ServeRAID M5015 SAS/SATA
o IBM ServeRAID-MR10i
o Intel RAID Controller SROMBSAS18E
FILES
/dev/mfid? array/logical disk interface
/dev/mfi? management interface
DIAGNOSTICS
mfid%d: Unable to delete busy device An attempt was made to remove a mounted volume.
SEE ALSO
amr(4), pci(4), mfiutil(8)
HISTORY
The mfi driver first appeared in FreeBSD 6.1.
AUTHORS
The mfi driver and this manual page were written by Scott Long <scottl@FreeBSD.org>.
BUGS
The driver does not support big-endian architectures at this time.
BSD
May 12, 2010 BSD