10-15-2010
There is nothing in the corrected script which would give trouble with filenames containing hyphen characters because you have double quotes round the variables. The only filename which might give trouble is a filename starting with a hyphen character which is why we avoid such filenames.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a problem.
I have some text files in a folder. The names can be like:
emp.txt
emp1.txt
emp3.txt
32emp4.txt
What i need is i have to copy all the files which have "emp" string in their filename
to a different folder and those file names... (7 Replies)
Discussion started by: pathanjalireddy
7 Replies
2. Shell Programming and Scripting
I would like to copy files from one directory to another directory while renaming them at the same time. Does anyone have any ideas on how to do this in a script?
Basically, would like to copy files from
/user/data/prod/*.txt
to
/user/data/bck/*.txt.bck (3 Replies)
Discussion started by: thunderkiss65
3 Replies
3. Shell Programming and Scripting
Hi,
There is file generated automatically at /usr/files as fileYYYYMM(e.g file201005 and so on).
I need a script that will i)pick up the latest file from that path ii)rename the copied file to fileYYYYMM and then iii)copy to another server at path /usr/dest.If the file name with same name... (1 Reply)
Discussion started by: Alok Ranjan
1 Replies
4. UNIX for Dummies Questions & Answers
Hi Geeks,
I am relatively new to Unix. Trying out to achive a shell script by hard learning. Here is my requirment.
1. I have to search for specified strings that are given in .csv file in the directory to find the files for matching strings in the .csv file.
2. If match is found, copy... (1 Reply)
Discussion started by: uunniixxuusseer
1 Replies
5. Shell Programming and Scripting
Hey all!
Sorry for the noobish question..
I am wondering how to I copy multiple files, and rename them based on their directory at once.
So, I have files like this
/logs/server/2011-10/server-1/log/file/folder/some.log.gz
/logs/server/2011-10/server-2/log/file/folder/some.log.gz... (3 Replies)
Discussion started by: m3power206
3 Replies
6. Shell Programming and Scripting
hi,
source directory as /home/home01
target directort as /home/home02
I have below files in source directory:
FrontOf_history.dat
FrontOf_history1.dat
In target directory have many files as:
Kront_2014.dat
Kront_2015.dat
Kront_2016.dat
Now i want to copy the two files... (1 Reply)
Discussion started by: Vivekit82
1 Replies
7. UNIX for Dummies Questions & Answers
Hi
I think this should be relatively simple but I can't figure it out. I have several files with the same name in different folders within a directory (the output of a program that I ran). Something like this:
./myAnalysis/item1/round1/myoutput.txt
./myAnalysis/item1/round2/myoutput.txt... (2 Replies)
Discussion started by: jullee
2 Replies
8. Shell Programming and Scripting
Below is the script i have but i would like simplified but still do the same job.
I need a script to copy files not directories or sub-directories into a existing or new directory. The files, if have the same name but different extension; for example 01.doc 01.pdf then only copy the .doc file. ... (1 Reply)
Discussion started by: Gilljambo
1 Replies
9. Shell Programming and Scripting
Hi All,
I need to copy files from one directory to another with the files to be renamed while copying if a file with the same name already exists in the target directory.
THanks,
Dev (2 Replies)
Discussion started by: dev.devil.1983
2 Replies
LEARN ABOUT ULTRIX
qmail-getpw
qmail-getpw(8) System Manager's Manual qmail-getpw(8)
NAME
qmail-getpw - give addresses to users
SYNOPSIS
qmail-getpw local
DESCRIPTION
In qmail, each user controls a vast array of local addresses. qmail-getpw finds the user that controls a particular address, local. It
prints six pieces of information, each terminated by NUL: user; uid; gid; homedir; dash; and ext. The user's account name is user; the
user's uid and gid in decimal are uid and gid; the user's home directory is homedir; and messages to local will be handled by home-
dir/.qmaildashext.
In case of trouble, qmail-getpw exits nonzero without printing anything.
WARNING: The operating system's getpwnam function, which is at the heart of qmail-getpw, is inherently unreliable: it fails to distinguish
between temporary errors and nonexistent users. Future versions of getpwnam should return ETXTBSY to indicate temporary errors and ESRCH
to indicate nonexistent users.
RULES
qmail-getpw considers an account in /etc/passwd to be a user if (1) the account has a nonzero uid, (2) the account's home directory exists
(and is visible to qmail-getpw), and (3) the account owns its home directory. qmail-getpw ignores account names containing uppercase let-
ters. qmail-getpw also assumes that all account names are shorter than 32 characters.
qmail-getpw gives each user control over the basic user address and all addresses of the form user-anything. When local is user, dash and
ext are both empty. When local is user-anything, dash is a hyphen and ext is anything. user may appear in any combination of uppercase
and lowercase letters at the front of local.
A catch-all user, alias, controls all other addresses. In this case ext is local and dash is a hyphen.
You can override all of qmail-getpw's decisions with the qmail-users mechanism, which is reliable, highly configurable, and much faster
than qmail-getpw.
SEE ALSO
qmail-users(5), qmail-lspawn(8)
qmail-getpw(8)