Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Problem with use of the ? wildcard in regex substitution. Post 302858123 by MadeInGermany on Saturday 28th of September 2013 09:30:49 PM
Old 09-28-2013
A safe match is
Code:
rename 's/\.m.mp3$/.mp3/' *mp3


Last edited by MadeInGermany; 09-28-2013 at 10:36 PM..
This User Gave Thanks to MadeInGermany For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find wildcard .shtml files in wildcard directories and removing them- How's it done?

I'm trying to figure out how to build a small shell script that will find old .shtml files in every /tgp/ directory on the server and delete them if they are older than 10 days... The structure of the paths are like this: /home/domains/www.domain2.com/tgp/ /home/domains/www.domain3.com/tgp/... (1 Reply)
Discussion started by: Neko
1 Replies

2. AIX

VI Substitution problem

I'm having a problem getting my variables to work in dishing out an RMC script. The $1 works fine. $2 does not Here's a portion of the script: server=$1 filesystem1=$2 # dsh -w $1 'mkcondition -c "/var space used" -s "Name == \"$2\"" -e "PercentTotUsed > 90" -d "An event will be generated... (7 Replies)
Discussion started by: gravy26
7 Replies

3. Shell Programming and Scripting

sed help/wildcard substitution

I need to perform the following substitutions and have been struggling to determine if or how I can do this with sed or perl. I need to change the string foo(bar) to moo(bar,0) wherever this occurs in a file. Is there a way to do this? I'm thinking there might be a wildcard of some sort that... (4 Replies)
Discussion started by: Mike@NZ
4 Replies

4. Solaris

Problem in using wildcard characters in xargs with find

Hi, Under my parent diectory I have directory named "Response" in many of its subfolders. I am interested to see all files with extention .pro in Response Directory. I am giving following command - find . -name "Response" -type d | xargs -i ls -lrt {}/*.pro but it is not giving result. ... (3 Replies)
Discussion started by: sanjay1979
3 Replies

5. Shell Programming and Scripting

Problem when concatinating wildcard onto file location in bash script

I am having difficulty with the following script: #! /bin/bash filelist=~/data/${1}* ~/./convertFile $filelist ~/temp/outputEssentially, there are a large number of files in the directory ~/data, each with a four-letter code at the beginning (eg. aaaa001 aaaa002 bbbb001 bbbb002 etc). The... (11 Replies)
Discussion started by: Lears_Fool
11 Replies

6. Shell Programming and Scripting

Another substitution problem

Hello again, I'm trying to change the following line: INSERT INTO PH1_TX_LOAD VALUES ('TX-78731-AABSS:4182-4','RH: GUIDE TO TENNIS',TO_DATE('18-JUN-2001:00:00:00', 'DD-MON-YYYY:HH24:MI:SS'),TO_DATE('21-JUN-2001:00:00:00', 'DD-MON-YYYY:HH24:MI:SS'),500) so that any TO_DATE is taken... (6 Replies)
Discussion started by: user_invalid
6 Replies

7. Shell Programming and Scripting

wildcard in sed substitution

I have a number of strings that I want to remove: <b>Task: 100</b> <b>Task: 1100 </b> <b>Task: 2200 </b> But the numbers in them can vary from 4, 5 8, digits in length. But, no alpha chars. I tried this: sed '/Task:/,//d' $file > tmpfile ; mv tmpfile $file But it removed additional text on... (5 Replies)
Discussion started by: dba_frog
5 Replies

8. UNIX for Advanced & Expert Users

sudo wildcards problem: for every argument a *-wildcard? Better solution?

Hi I allow the user tommy to run this command as root sudoCommand: /app/appname/connectors/*/*/current/bin/*With "sudo -l" he sees the sudoers, but is unable to execute. $ sudo /app/appname/connectors/zur/namename/current/bin/othername agentsvc --i --u root --sn 1m7command Sorry, user... (2 Replies)
Discussion started by: slashdotweenie
2 Replies

9. Shell Programming and Scripting

wildcard in regex for awk

Hello I have a file like : 20120918000001413 | 1.17.163.89 | iSelfcare | MSISDN | N 20120918000001806 | 1.33.27.100 | iSelfcare | 5564 | N .... I want to extract all lines that have on 4th field (considering "|" the separator ) something other than just digits. I want to do this using a... (5 Replies)
Discussion started by: black_fender
5 Replies

10. Shell Programming and Scripting

Help with sed substitution / regex

Hi all, please can anyone show me how to use sed and regular expressions to achieve the following. If a line contains a capital A followed by exactly 5 or 6 characters followed by an angled bracket then insert an asterix before the angled bracket. So: XCONFIGA12345<X Becomes: ... (5 Replies)
Discussion started by: Jedimark
5 Replies
dr_symlinks(1)							  USER COMMANDS 						    dr_symlinks(1)

  NAME
      dr_unsort - unsort the current mpd playlist

  SYNOPSIS
      dr_unsort

  DESCRIPTION
      dr_unsort invokes unsort(1) on the current audio playlist as used by mpd.  Use it if you'd like some variation in your music.

  EXAMPLE
      If The_Beatles/The_White_Album_I/03-Glass_Onion.ogg is the current playing track and your current playlist looks like

	Flying_Lotus/Los_Angeles/01 Brainfeeder.mp3
	The_Beatles/The_White_Album_I/01-Back_in_the_U.S.S.R..ogg
	The_Beatles/The_White_Album_I/02-Dear_Prudence.ogg
      > The_Beatles/The_White_Album_I/03-Glass_Onion.ogg
	The_Beatles/The_White_Album_I/04-Ob-La-Di,_Ob-La-Da.ogg
	The_Beatles/The_White_Album_I/05-Wild_Honey_Pie.ogg
	The_Beatles/The_White_Album_I/06-The_Continuing_Story_of_Bungalow_Bill.ogg
	The_Beatles/The_White_Album_I/07-While_My_Guitar_Gently_Weeps.ogg
	Flying_Lotus/Los_Angeles/02 Breathe . Something_Stellar STar.mp3
	Flying_Lotus/Los_Angeles/03 Beginners Falafel.mp3
	Flying_Lotus/Los_Angeles/04 Camel.mp3
	Napalm_Death/The_Peel_Sessions/01-The_Kill-Prison_Without_Walls-Dead_Part_1.mp3
	Napalm_Death/The_Peel_Sessions/02-Deceiver-Lucid_Fairytale-In_Extremis.mp3
	Napalm_Death/The_Peel_Sessions/03-Blind_To_The_Truth-Negative_Approach-Common_Enemy.mp3
	Napalm_Death/The_Peel_Sessions/04-Obstinate_Direction-Life-You_Suffer_Pt_2.mp3
	Flying_Lotus/Los_Angeles/05 Melt!.mp3
	Flying_Lotus/Los_Angeles/06 Comet Course.mp3
	Flying_Lotus/Los_Angeles/07 Orbit 405.mp3
	Flying_Lotus/Los_Angeles/08 Golden Diva.mp3

      invoking dr_unsort will yield something like e.g.

	Flying_Lotus/Los_Angeles/01 Brainfeeder.mp3
	The_Beatles/The_White_Album_I/01-Back_in_the_U.S.S.R..ogg
	The_Beatles/The_White_Album_I/02-Dear_Prudence.ogg
      > The_Beatles/The_White_Album_I/03-Glass_Onion.ogg
	Flying_Lotus/Los_Angeles/02 Breathe . Something_Stellar STar.mp3
	The_Beatles/The_White_Album_I/04-Ob-La-Di,_Ob-La-Da.ogg
	Napalm_Death/The_Peel_Sessions/01-The_Kill-Prison_Without_Walls-Dead_Part_1.mp3
	Flying_Lotus/Los_Angeles/03 Beginners Falafel.mp3
	The_Beatles/The_White_Album_I/05-Wild_Honey_Pie.ogg
	Napalm_Death/The_Peel_Sessions/02-Deceiver-Lucid_Fairytale-In_Extremis.mp3
	Flying_Lotus/Los_Angeles/04 Camel.mp3
	The_Beatles/The_White_Album_I/06-The_Continuing_Story_of_Bungalow_Bill.ogg
	Napalm_Death/The_Peel_Sessions/03-Blind_To_The_Truth-Negative_Approach-Common_Enemy.mp3
	Flying_Lotus/Los_Angeles/05 Melt!.mp3
	The_Beatles/The_White_Album_I/07-While_My_Guitar_Gently_Weeps.ogg
	Napalm_Death/The_Peel_Sessions/04-Obstinate_Direction-Life-You_Suffer_Pt_2.mp3
	Flying_Lotus/Los_Angeles/06 Comet Course.mp3
	Flying_Lotus/Los_Angeles/07 Orbit 405.mp3
	Flying_Lotus/Los_Angeles/08 Golden Diva.mp3

  WARNING
      Due to limitations in the mpc/mpd protocol, dr_unsort needs filesystem level write access to mpd's playlist directory.

  ENVIRONMENT
      dr_unsort honors strings DR_PLAYLISTS (mpd's playlist directory) and DR_UNSORT (unsort pathname).

  SEE ALSO
      unsort(1), available from http://packages.debian.org/unsort.

  COPYRIGHT AND LICENSE
      This manpage is copyright 2010, 2011 Joost van Baal <joostvb-draai@mdcc.cx>.

      Draai is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, as published by the Free
      Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed	WITHOUT  ANY  WAR-
      RANTY. You should have received a copy of the GNU General Public License along with draai. If not, see http://www.gnu.org/licenses/.

  AUTHOR
      Joost van Baal <joostvb-draai@mdcc.cx>

  dr_symlinks 20110603						     03 juin 2011						      dr_symlinks(1)
All times are GMT -4. The time now is 01:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy