I have an audit log that is produced each day from a production printer. It names the file using todays date, but it removes the leading zero's. For example: todays date 060104 names the file 6104.txt.
I ftp this file onto a Sun box and pull stats off of it. To keep some consistency to what I am... (2 Replies)
Hi,
Is it possible to rename with wild charaters as destination name
ex
I wanna rename xxx_1010_zzz_0.txt to aaa_1010_zzz_1.txt,
yyy_1000_ppp_1.txt to bbb_1000_ppp.0.txt
I wanna reatin some of the patterns in the filename, rest I wanna rename.
like
mv... (2 Replies)
How can I rename files named like these
iq - 000001 - 2008.07.31 - 14.49.47 - location1.bin
iq - 000001 - 2008.07.31 - 14.49.47 - location12.bin
iq - 000008 - 2008.07.31 - 14.52.01 - location500.bin
to
iq_2008.07.31_14.49.47_location1.bin
iq_2008.07.31_14.49.47_location12.bin... (7 Replies)
Hi All,
I would like to find out the existence of files with wild card using CSH.
I have used the below code but does not seem to work.
Can any expert give me some advice ?
set nonomatch
set pattern = "_xxx"
set filetype = ( *$pattern* )
if ( -e $filetype) then
echo... (2 Replies)
have this shl that will FTP a file from the a directory in windows to UNIX, It get the name of the file stored in this variable $UpLoadFileName then put in the local directory LocalDir="${MPATH}/xxxxx/dat_files" that part seems to be working, but then I need to take that file and rename, I am using... (3 Replies)
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 have a file named as Pro_PatAct_MMDDYYYY.csv. I need to renmae it to this Pro_PatAct.csv without the date timestamp. Can someone help me to achieve this using a regular expn. (3 Replies)
Hi
Am trying to move a file from one name to another
When I do "ls" to check for the moved filename
I can see the file but when I try the same with a script am unable..
I think am doing some pretty silly error.. please help..
toMove=`ls | grep -E "partition.+"`
mv $toMove partition._org... (7 Replies)
Hi
I would like to rename Multiple files in a Unix Directory using Ksh Command.
Eg ATT8-2011-10-01 00:00:00-MSA-IMM-SINGLE_AND_FAMILY_COVERAGE-DED-$2000-X114817.PDF
needs to be renamed as
ATT8-2011-10-01-MSA-IMM-SINGLE_AND_FAMILY_COVERAGE-DED-$2000-X114817.PDF
Basically the time... (2 Replies)
Hi experts,
I am new to perl.
I am trying to get the last file from set of files.
Using the below code; but getting error
pls help
Files:
-rw-r--r-- 1 abc abc 12584 Mar 18 16:22 /abc/def/ghi/xyz.HOSTNAME.2016.03.18.16.21.69709-6
-rw-r--r-- 1 abc abc 12623 Mar 18 16:25... (4 Replies)
Discussion started by: sdosanjh
4 Replies
LEARN ABOUT ULTRIX
rename
rename(2) System Calls Manual rename(2)Name
rename - change the name of a file
Syntax
rename(from, to)
char *from, *to;
Description
The system call causes the link named from to be renamed to. If to exists, then it is first removed. Both from and to must be of the same
type (that is, both directories or both nondirectories) and must reside on the same file system.
The system call guarantees that an instance of to will always exist, even if the system should crash in the middle of the operation.
Return Values
A zero (0) value is returned if the operation succeeds. Otherwise returns -1, and the global variable errno indicates the reason for the
failure.
Restrictions
The system can deadlock if a loop in the file system graph is present.and two processes issue the call at the same time. For example, sup-
pose a directory, contains a file, Suppose that file is hard-linked to a directory, and the directory contains a file, If is hard-linked to
a loop exists. Now suppose one process issues the following call:
rename (dirname/filename secondir/secondfile)
At the same time, another process issues the following call:
rename (secondir/secondfile dirname/filename)
In this case, the system can deadlock. The system administrator should replace hard links to directories with symbolic links.
Diagnostics
The system call fails and neither of the argument files are affected under the following conditions:
[ENOTDIR] A component of either path prefix is not a directory.
[ENOENT] A component of the from path does not exist, or a path prefix of to does not exist.
[ENOENT] Either from or to points to an empty string and the environment defined is POSIX or SYSTEM_FIVE.
[EACCES] A component of either path prefix denies search permission.
[EPERM] The to file exists, the directory containing from is marked sticky, and neither the containing directory nor the to direc-
tory is owned by the effective user ID.
[EPERM] The directory containing from is marked sticky, and neither the containing directory nor the from directory is owned by the
effective user ID.
[EXDEV] The link named by to and the file named by from are on different logical devices (file systems). Note that this error code
is not returned if the implementation permits cross-device links.
[EACCES] The requested link requires writing in a directory with a mode that denies write permission.
[EROFS] The requested link requires writing in a directory on a read-only file system.
[EFAULT] The path points outside the process's allocated address space.
[EINVAL] The from is a parent directory of to, or an attempt is made to rename dot (.) or dot-dot (..).
[ENAMETOOLONG] A component of either pathname exceeded 255 characters, or the entire length of either pathname exceeded 1023 characters.
[ELOOP] Too many symbolic links were encountered in translating either pathname.
[ENOTDIR] The from is a directory, but to is not a directory.
[EISDIR] The to is a directory, but from is not a directory.
[ENOSPC] The directory in which the entry for the new name is being placed cannot be extended, because there is no space left on the
file system containing the directory.
[EDQUOT] The directory in which the entry for the new name is being placed cannot be extended, because the user's quota of disk
blocks on the file system containing the directory has been exhausted.
[EIO] An I/O error occurred while making or updating a directory entry.
[ENOTEMPTY] The to is a directory and is not empty.
[EBUSY] The directory named by from or to is a mount point.
See Alsoopen(2)rename(2)