Sponsored Content
Top Forums Shell Programming and Scripting Replace characters in all file names in a particular directory Post 99383 by bigearsbilly on Thursday 16th of February 2006 06:10:52 PM
Old 02-16-2006
oops! slight error should be # not %
Code:
#!/bin/bash

for f in bdw* ;do
        echo mv $f fdm${f#bdw}
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Weird Ascii characters in file names

Hi. I have files in my OS that has weird file names with not-conventional ascii characters. I would like to run them but I can't refer them. I know the ascii # of the problematic characters. I can't change their name since it belongs to a 3rd party program... but I want to run it. is there... (2 Replies)
Discussion started by: yamsin789
2 Replies

2. UNIX for Dummies Questions & Answers

Listing full file names with the exact length of 3 characters

This is what I have to do: Display the full file name (including the full path) and file size of all files whose name (excluding the path) is exactly 3 characters long. This is the code I have: find / -printf "Name: %f Path: %h Size: %s (bytes)\n" 2>/dev/null | grep -E "Name: .{3,} Path" |... (7 Replies)
Discussion started by: Joesgrrrl
7 Replies

3. UNIX for Dummies Questions & Answers

removing first 7 characters of directory names

Hi, I'm relatively new to unix, and would like to change the following files in a particular directory. The files have names like: M10_90_Phcn402_3F.ab1 M10_94_Sput402_3F.ab1 M11_92_Abrg402_3R.ab1 M10_91_Cdel402_3F.ab1 M11_90_Phcn402_3R.ab1 M12_84_Sput402_3R.ab1... (4 Replies)
Discussion started by: euspilapteryx
4 Replies

4. Shell Programming and Scripting

Searching for file names in a directory while ignoring certain file names

Sun Solaris Unix Question Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain... (2 Replies)
Discussion started by: 2reperry
2 Replies

5. Shell Programming and Scripting

Finding File Names Ending In 3 Random Numerical Characters

Hi, I have a series of files (upwards of 500) the filename format is as follows CC10-1234P1999.WGS84.p190 each of this files is in a directory named for the file but excluding the extension. Now the last three numeric characters, in this case 999, can be anything from 001 to 999, I need to... (3 Replies)
Discussion started by: roche.j.mike
3 Replies

6. Shell Programming and Scripting

Grepping file names, comparing them to a directory of files, and moving them into a new directory

got it figured out :) (1 Reply)
Discussion started by: sHockz
1 Replies

7. Shell Programming and Scripting

share a shell script which can replace weird characters in directory or file name

I just finish the shell script . This shell can replace weird characters (such as #$%^@!'"...) in file or directory name by "_" I spent long time on replacing apostrophe in file/directory name added: 2012-03-14 the 124th line (/usr/bin/perl -i -e "s#\'#\\'#g" /tmp/rpdir_level$i.tmp) is... (5 Replies)
Discussion started by: begonia
5 Replies

8. Tips and Tutorials

How to manage file names with special characters

One of the common questions asked are: how do i remove/move/rename files with special (non-printable) characters in their name? "Special" doesn't always mean the same. As there are more and less special characters, some solutions are presented, ranging from simple to very complicated. Usually a... (0 Replies)
Discussion started by: bakunin
0 Replies

9. UNIX for Dummies Questions & Answers

[solved]removing characters from a mass of file names

I found a closed thread that helped quite a bit. I tried adding the URL, but I can't because I don't have enough points... ? Modifying the syntax to remove ! ~ find . -type f -name '*~\!]*' | while IFS= read -r; do mv -- "$REPLY" "${REPLY//~\!]}"; done These messages are... (2 Replies)
Discussion started by: rabidphilbrick
2 Replies

10. UNIX for Dummies Questions & Answers

How to remove first few characters from multiple file names without do loop?

Hi Fellows, I was wondering how I can remove first few characters from multiple file names without do loop in unix? e.g. water123.xyz water456.xyz to 123.xyz 456.xyz Thanks Paul Thanks. (3 Replies)
Discussion started by: Paul Moghadam
3 Replies
FDM(1)							    BSD General Commands Manual 						    FDM(1)

NAME
fdm -- fetch and deliver mail SYNOPSIS
fdm [-hklmnqv] [-a account] [-D name= value] [-f conffile] [-u user] [-x account] [fetch | poll] DESCRIPTION
The fdm program fetches mail from a POP3 or IMAP server or from stdin and delivers it based on a ruleset in the configuration file. The options are as follows: -a name Process only the specified account. This option may appear multiple times. The account name may include shell glob characters to match multiple accounts. -D name=value This option defines a macro for use when parsing the configuration file. The macro name must be prefixed with $ or % to specify a string or numeric macro. This option may appear multiple times. -f conffile Specify the configuration file location. Default is ~/.fdm.conf, or /etc/fdm.conf if that doesn't exist. -h Look at the HOME environment variable to ascertain the user's home directory. -k Keep all mail after delivery, regardless of whether it matches a drop action. Note that mails kept in this way will be refetched by fdm if it is run again on the same account. -l Log using syslog(3) rather than to stderr. -m Ignore the lock file and run regardless of other instances of fdm. -n Do not process any accounts, just verify the configuration file syntax and exit. -q Quiet mode. Only print errors. -u user Specify the default user for delivery. This overrides the default-user option in the configuration file. -v Request verbose logging. This option may be specified multiple times. -vv will print information on configuration (useful with -n). -vvvv duplicates all traffic to and from remote servers to stdout. This feature is disabled when using the -l flag. -x name Exclude the named account. Multiple -x options may be specified. As with -a, shell glob characters may be used. fetch | poll | cache The fetch command instructs fdm to fetch and deliver messages. The poll command polls the accounts in the configuration file and reports a message count for each. cache allows fdm cache files to be manipulated: see the next section. CACHE COMMANDS
The following cache manipulation commands are supported: cache add path string cache remove path string Add or remove string as a key in the cache at path. cache list [path] List the number of keys in the specified cache, or if path is omitted, in all caches declared in the configuration file. cache dump path Dump the contents of the cache path to stdout. Each key is printed followed by a space and the timestamp as Unix time. cache clear path Delete all keys from the cache at path. FILES
~/.fdm.conf default fdm configuration file /etc/fdm.conf default system-wide configuration file ~/.fdm.lock default lock file /var/db/fdm.lock lock file for root user SEE ALSO
mail(1), fdm.conf(5), sendmail(8) AUTHORS
Nicholas Marriott <nicm@users.sourceforge.net> BSD
December 22, 2008 BSD
All times are GMT -4. The time now is 07:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy