#SD=source dir TD= target dir
SD="$/amddev/app01/manoj/new/scripts/old"
TD="$/amddev/app01/manoj/new/scripts/new"
EXT="$*.txt"
for i in `ls -F "$SD"/*"$EXT"|grep -v /$` do
mv "$SD" "$TD"
if
then
echo "$i" successfully moved
echo Manoj successfully..1 ( here i... (8 Replies)
Hi ,
I need a shell script which basicaly moves all the files from one folder say folder x to folder y and once they are moved to folder y a datetimestamp should be attached to there name
for ex
file a should be moved to y folder and renamed as a_20081015 (1 Reply)
hi
i am reading files from directory,if the files matches certain condition i need to move that file to another directory
i am using
if
then
mv $file1 > $UNIQDIR
fi
but i am gettin error , please help
thanks
Satya (4 Replies)
Hi All,
I am new to Forums, as i am struggling for one script i am launched here.
I need to move more than 60,000+ folders in 1,00,000 folders to another server. I have the list of folders which should be moved. can anybody help me in sharing with the script for the above requirement.
... (4 Replies)
Hi Experts,
I have a "Source" folder which may contain some files. I need a shell script which should move all files which are older than 3 days to "Archive" folder.
Thanks in Advance... (4 Replies)
I have created this script and does not seem to be behaving well.
Basically I am in a directory, I just want to do down two directories, run the script
georom_replaceText.tcsh
This will produce a file in the subdirectory, which I then run. Finally go back to where I started. Afterwards I... (4 Replies)
Dear All,
I am having a database that generates daily backup files in the below format.
abc_date_0010.zip.
Can you please suggest a method to copy the last day's file to another location.
I am trying with if statement, but having difficulty while I use the condition like
if ; then
... (4 Replies)
Hi there,
I am an absolut beginner in scripting.
I am using Ubuntu Linux 18.04 LTS:
I just need some hints/suggestions how a script could look like doing the following stuff:
assuming I am in directory "base_directory"
like
xyz@mypc:~/base_directory$
within the "base_directory there... (1 Reply)
Discussion started by: dut42
1 Replies
LEARN ABOUT OPENSOLARIS
realpath
realpath(3C) Standard C Library Functions realpath(3C)NAME
realpath - resolve pathname
SYNOPSIS
#include <stdlib.h>
char *realpath(const char *restrict file_name,
char *restrict resolved_name);
DESCRIPTION
The realpath() function derives, from the pathname pointed to by file_name, an absolute pathname that names the same file, whose resolution
does not involve ".", "..", or symbolic links. The generated pathname is stored as a null-terminated string, up to a maximum of {PATH_MAX}
bytes (defined in limits.h(3HEAD)), in the buffer pointed to by resolved_name.
RETURN VALUES
On successful completion, realpath() returns a pointer to the resolved name. Otherwise, realpath() returns a null pointer and sets errno
to indicate the error, and the contents of the buffer pointed to by resolved_name are left in an indeterminate state.
ERRORS
The realpath() function will fail if:
EACCES Read or search permission was denied for a component of file_name.
EINVAL Either the file_name or resolved_name argument is a null pointer.
EIO An error occurred while reading from the file system.
ELOOP Too many symbolic links were encountered in resolving file_name.
ELOOP A loop exists in symbolic links encountered during resolution of the file_name argument.
ENAMETOOLONG The file_name argument is longer than {PATH_MAX} or a pathname component is longer than {NAME_MAX}.
ENOENT A component of file_name does not name an existing file or file_name points to an empty string.
ENOTDIR A component of the path prefix is not a directory.
The realpath() function may fail if:
ENAMETOOLONG Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.
ENOMEM Insufficient storage space is available.
USAGE
The realpath() function operates on null-terminated strings.
Execute permission is required for all the directories in the given and the resolved path.
The realpath() function might fail to return to the current directory if an error occurs.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO getcwd(3C), limits.h(3HEAD), sysconf(3C), attributes(5), standards(5)SunOS 5.11 9 Oct 2003 realpath(3C)