I tried your code but its giving me the following output:
but when I remove the "" in the mv command I get
Is this because a.txt and b.txt in this case are files containing entries and not real .ab1 files ??
I will do this will real files soons and let you know but if you can comment on the code to simplfy what its doing its will be a big help. At the moment I dont understand it
I want to write a shell script that will rename all the file names to today's date attached to it..
so for example i have a file names like
file1.sales.20081201.txt.c
zbrs.salestxtn.20091101.txt.inn
then it will rename both the files with todays date to it so the file names get changed... (1 Reply)
I have a file that looks like this
2 4 10 500 tim9
5 8 14 700 tim9
3 5 15 432 john1
1 4 12 999 ellen2
So basically what i want to do is fine duplicate names on column 5 and rename it with an extention (i.e. tim9_1 and tim9_2).
so the output file will look like this
2 4 10 500 tim9_1... (1 Reply)
I have to rename a large number of files so that the name of each file corresponds to a code number that is given side by side in a list (textfile).
The list contains in column A the filename of the actual files to be renamed and in column B the name (a client code, 9 digits) that has to be... (7 Replies)
I haven’t used Unix in over 25 years … and so I am at a loss for something that should be very simple. I have a lot of jpeg files (i.jpg) of students in a yearbook.. I also have an array name(i) of their names. I need to rename each “i.jpg” to “name(i).jpg”. I believe the ksh script... (11 Replies)
I have 7 files with 7 different names coming into a specified folder on weekly basis, i need to pick a file one after another and load into oracle table using sql loader. I am using ksh to do this. So in the process if the file has error records and if sql loader fails to load into oracle tables,... (2 Replies)
Hi there,
Firstly, I have no experience with shell scripts so would really appreciate some help.
I have the following shell script that is causing some problems:
moveit()
{
&& set -x
if
then
DOUBLE_DELIVERY=$(grep... (6 Replies)
I have hundreds of files with weird names, something like this:
I was wondering how can I rename them all keeping the sampleid and the last extension, something like this:
Any help will be greatly appreciated. (5 Replies)
Hi Team,
I'm new to Unix shell scripting .
I've the following requirement
A folder contains the list of files with the following format
ab.name.11.first
ab.name.12.second
ab.name.13.third
----------
I have to rename the above file to like below
... (6 Replies)
Data files coming in different names in a file name called process.txt.
1. shipments_yyyymmdd.gz
2 Order_yyyymmdd.gz
3. Invoice_yyyymmdd.gz
4. globalorder_yyyymmdd.gz
The process needs to discard all the below files and only process two of the 4 file names available
... (1 Reply)
Hi, I have about 60 files in a directory and need to rename those files. For example the file names are
i_can_phone_yymmdd.txt (where yymmdd is the date. i.e 170420 etc)
i_usa_phone_1_yymmdd.txt
i_eng_phone_4_yymmdd.txt
The new file names should be
phone.txt
phone_1.txt
phone_4.txt
I am... (4 Replies)
Discussion started by: naveed
4 Replies
LEARN ABOUT OSX
cpmac
CPMAC(1) BSD General Commands Manual CPMAC(1)NAME
/usr/bin/CpMac -- copy files preserving metadata and forks
SYNOPSIS
/usr/bin/CpMac [-rp] [-mac] source target
/usr/bin/CpMac [-rp] [-mac] source ... directory
DESCRIPTION
In its first form, the /usr/bin/CpMac utility copies the contents of the file named by the source operand to the destination path named by
the target operand. This form is assumed when the last operand does not name an already existing directory.
In its second form, /usr/bin/CpMac copies each file named by a source operand to a destination directory named by the directory operand. The
destination path for each operand is the pathname produced by the concatenation of the last operand, a slash, and the final pathname compo-
nent of the named file.
The following options are available:
-r If source designates a directory, /usr/bin/CpMac copies the directory and the entire subtree connected at that point. This option also
causes symbolic links to be copied, rather than indirected through, and for /usr/bin/CpMac to create special files rather than copying
them as normal files. Created directories have the same mode as the corresponding source directory, unmodified by the process' umask.
-p Causes /usr/bin/CpMac to preserve in the copy as many of the modification time, access time, file flags, file mode, user ID, and group
ID as allowed by permissions.
-mac Allows use of HFS-style paths for both source and target. Path elements must be separated by colons, and the path must begin with a
volume name or a colon (to designate current directory).
NOTES
The /usr/bin/CpMac command does not support the same options as the POSIX cp command, and is much less flexible in its operands. It cannot
be used as a direct substitute for cp in scripts.
As of Mac OS X 10.4, the cp command preserves metadata and resource forks of files on Extended HFS volumes, so it can be used in place of
CpMac. The /usr/bin/CpMac command will be deprecated in future versions of Mac OS X.
SEE ALSO cp(1)MvMac(1)Mac OS X April 12, 2004 Mac OS X