Sponsored Content
Full Discussion: Perl equivalent substitution
Top Forums Shell Programming and Scripting Perl equivalent substitution Post 302854471 by lohith.dutta on Tuesday 17th of September 2013 02:02:07 PM
Old 09-17-2013
Perl equivalent substitution

hi Geeks,
my input file contains data like =>
Code:
[Songspk.name] 53 - Deewana Kar Raha Hai.mp3
[Songspk.name] 54 - Hale Dil.mp3
[Songspk.name] 55 - Ishq Sufiyana.mp3
[Songspk.name] 56 - Abhi Kuch Dino Se.mp3
[Songspk.name] 57 - Pee Loon Hoto Ki Sargam.mp3

I had used sed command to remove the prefix from the file name like
Code:
sed 's/^\[.*- \(.*.mp3\)/\1/' file

it gives me the perfect result. but now I want the same result by using the perl substitution.

I tried this command
Code:
perl -e 's/^\[.*- \(.*.mp3\)/\1/' file

but unfortunately it doesn't return anything and echo $? returns 0.

Kindly advise .. thanks in advance.

-Lohit.

Last edited by Scott; 09-17-2013 at 03:04 PM.. Reason: Code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl equivalent of ksh if / echo statement

Is there an equivalent perl statement for the following ksh statement ? example if then ... else ... fi (2 Replies)
Discussion started by: gefa
2 Replies

2. Shell Programming and Scripting

export equivalent command in PERL

Hi I need an equivalent command in PERL for the following. export LC_ALL=C; I hope this is the command. Please confirm this and correct me if i am wrong $ENV{LC_ALL}="C"; Thanks and Regards Ammu (1 Reply)
Discussion started by: ammu
1 Replies

3. Shell Programming and Scripting

perl equivalent to grep -c

Guess the subject lines says it all. What is the perl equivalent to grep -c -c, --count Suppress normal output; instead print a count of match- ing lines for each input file. With the -v, --invert- match option (see below), count non-matching lines. ... (6 Replies)
Discussion started by: popeye
6 Replies

4. Shell Programming and Scripting

strtok equivalent in perl

Hi All, Is their any equivalent for strtok (in c) to use in perl script. Thanks in advance. JS (1 Reply)
Discussion started by: jisha
1 Replies

5. Shell Programming and Scripting

Bash equivalent of perl's pack function ?

Is there an equivalent of perl's pack function in bash ? Or in other words, how can I achieve the same thing in bash ? Much appreciated. (1 Reply)
Discussion started by: NewDeb
1 Replies

6. Shell Programming and Scripting

Regular expression matching in BASH (equivalent of =~ in Perl)

In Perl I can write a condition that evaluates a match expression like this: if ($foo =~ /^bar/) { do blah blah blah } How do I write this in shell? What I need to know is what operator do I use? The '=~' doesn't seem to fit. I've tried different operators, I browsed the man page for... (3 Replies)
Discussion started by: indiana_tas
3 Replies

7. Shell Programming and Scripting

need perl equivalent

Dear All, Good day, can any of you help me in the following problem: I need to find the perl equivalent for the following commandline grep characters |awk '{print \$2}'Expecting your reply and thanks in advance. Warm regards Fredrick. (4 Replies)
Discussion started by: Fredrick
4 Replies

8. Shell Programming and Scripting

grep -v equivalent in perl

I have to do grep -v in a perl script. I want to exclude blank lines and lines having visitor. #grep -v visitor abc.txt |grep '.' file:abc.txt 1340 not booked 16D:D9 tourist 8 1341 not booked 16C:D4 tourist 25 1342 not booked 16D:C4 visitor 7 1343 not booked 01C:D9 visitor 6 1344... (4 Replies)
Discussion started by: dynamax
4 Replies

9. Shell Programming and Scripting

What is the equivalent of NR (awk) in perl?

Hello, I searched online; it seems that perl use $NR as NR in awk; however it does not work for me. For example, how to re-write the following awk using perl: awk '{ print NR}' inputfile---------- Post updated at 01:55 PM ---------- Previous update was at 12:49 PM ---------- I found... (2 Replies)
Discussion started by: littlewenwen
2 Replies

10. Shell Programming and Scripting

Perl : Perl equivalent to the ksh | and ;

Ive been trying to move to Perl. It has been a struggle. My question is, is there a good resource that explains nesting statements. As an example. To change primary Factory CTS 1.9.0(46) P1 *Slot 1 CTS 1.10.2(42) P1 To primary *Slot 1 CTS 1.10.2(42) P1 ... (5 Replies)
Discussion started by: popeye
5 Replies
POC-FEC(1)							   User Command 							POC-FEC(1)

NAME
poc-fec - send FEC MP3 streams SYNOPSIS
poc-fec [ -s address ] [ -p port ] [ -t ttl ] [ -q ] [ -k fec_k ] [ -n fec_n ] files... DESCRIPTION
poc-fec is a streaming server sending mp3 data using a custom FEC protocol. The streamed MP3 frames are first decomposed in autonomous data units (ADUs). These ADUs are grouped into ADU groups, which are encoded redundantly using a FEC method by Luigi Rizzo. A group of k ADUs is encoded as n data packets. Any k of these n data packets is sufficient to recover the original k ADUs. It sends the files in the order given on the command-line. Use the filename - to stream from standard input. Normally, the FEC protocol is used to stream to multicast groups. OPTIONS
-s address Specify the address to send to (default 224.0.1.23). -p port Specify the port to send to (default 1500). -t ttl Specify the TTL parameter to be set on outgoing parameters (default 1). -q Don't output any information on standard error. -k fec_k Specify the number of ADUs that will be encoded as an ADU group (default 20). -n fec_n Specify the number of packets that the ADU groups will be encoded to (default 25). This number must be greater than the fec_k param- eter. EXAMPLES
poc-fec -s 224.0.1.24 -p 8989 -t 2 -k 16 -n 32 bla.mp3 Send the file bla.mp3 using the RTP RFC fec protocol to the address 224.0.1.24 on port 8989, and set the TTL to 2. MP3 frames of bla.mp3 are converted to ADUs and grouped in ADU groups of 16 ADUs. These 16 ADUs are encoded into 32 packets and streamed. A client will have to receive at least 16 packets to recover the original ADUs. AUTHORS
Manuel Odendahl <manuel@bl0rg.net>, Florian Wesch <dividuum@bl0rg.net> February 2005 POC-FEC(1)
All times are GMT -4. The time now is 12:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy