![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| read list of filenames from text file and remove these files in multiple directories | fxvisions | Shell Programming and Scripting | 5 | 08-07-2008 03:59 PM |
| read list of filenames from text file, archive, and remove | fxvisions | Shell Programming and Scripting | 5 | 03-20-2007 09:56 PM |
| Getting emials with SUSPECT: Prefix | akrathi | UNIX for Dummies Questions & Answers | 1 | 02-21-2006 03:11 PM |
| How to cut prefix from a string? | nir_s | Shell Programming and Scripting | 2 | 02-19-2006 04:16 PM |
| remove filename prefix | peter.herlihy | UNIX for Dummies Questions & Answers | 2 | 07-11-2002 01:08 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I'm trying to put together a shell script that will append specific prefixes based on the content of filenames. I think I have this part down. However, I want to append before that part a process that will remove the current prefix before it renames the files with the new prefix.
For example, if all the files I want to rename, for example are: --- ALPHANUM.ABCDEFG ALPHANUM.HIJKLMNOP ALPHANUM.QRSTUV ALPHANUM.WXYZ ALPHANUM.01234567890 --- and depending on the contents, if $[0-9] append the prefix "NUM." and $[A-Z] append prefix "ALPHA". The part where I'm stuck at is trying to figure out how to remove the "ALPHANUM." prefix before I do any appending. Tried searching through the forums with "remove suffix, change suffix, remove prefix, change prefix," and "prefix" to get some examples, but did not spot anything I'm trying to do. Please help. Thanks! |
|
||||
|
Thank you. I would like to use the bash shell though. Is there a website containing the differences between the shells, and specify which variable / command relates to the other, etc.? Also, the files I am actually working with to rename contains both alpha and numeric characters. How do I specify that the one common perfix for all the files are removed? (Using the bash shell.) Thanks!
|
|
||||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|