he below looks in $dir for any pattern of fileone. As is, it executes but only returns File found if the exact format in the script exsists. Why isn't a pattern of fileone being looked for and if it is in [CODE]$dir[/ICODE], File found. I think that is what should happen. Thank you .
Last edited by cmccabe; 11-15-2019 at 04:37 PM..
Reason: fixed format
Hello friends,
I am writing a simple shell script which will copy one particular type of files to backup folder if files exists. If files doesn't exists, mv command should not be executed.
My file pattern is like wcm-spider-maestro.log.2009-07-15, wcm-spider-maestro.log.2009-07-16 etc..
I... (6 Replies)
cp $PATHLOGS/$DATE/*.* $TMP/logs_tmp/
cp $PATHLOGS/$DATE1/*.* $TMP/logs_tmp/
Before copying the files I have to check if the directory $DATE1 and $DATE2 exists.
If directory exists then, check if the folder contains some files.
if the file exists then, check if the file size is greater... (3 Replies)
Hi,
I have two files say xxx.txt and yyy.txt. xxx.txt is with list of patterns within double quotes. Eg.
"this is the line1"
"this is the line2"
The yyy.txt with lot of lines. eg:
"This is a test message which contains rubbish information just to fill the page which is of no use. this is... (3 Replies)
I want to perform SQL *Loader operation only if a file named "load.txt" exists in a directory "/home/loc/etc". Please help how to check this with a if condition. (8 Replies)
Hi ! All
I just want to search and write to new file if pattern is found in text file
following are my text files by which I want to search Month and last column number
my text file1
15-Jan-2011 25 ARTS 1255 125 125 178 198
15-Jan-2011 25 ARTS 1255 125 125 178 198
15-Jan-2011 25... (3 Replies)
Hi Gurus,
I have a requests to find if all the file in the filelist exist in certain directory.
example:
my filelist
abc
def
ddd
cde
afg
how can I find these 5 files exists at director /home/abc
Thanks in advance (7 Replies)
Hi guys,
I am beginner trying to learn unix. So any help is welcomed.
My requirement is to check whether is a file exists in a particular directory or not.
The directory path and filename are taken dynamically with user interaction. So the program should continue only if the $filename... (1 Reply)
I have many files that can have various amounts of rows. I essentially want to output each row into a new file if a pattern is matched between two files.
I have some code that does something similar but I want it to output every single input row from every file into a separate output file; that... (5 Replies)
Hi experts,
I have two arrays one has the file paths to be searched in , and the other has the files to be serached.For eg
searchfile.dat will have
abc303
xyz123
i have to search for files that could be abc303*.dat or for that matter any extension . abc303*.dat.gz
The following code... (2 Replies)
There are some files with suffix dates like abc_20032019.dat abc_17032019.dat
If at least one file exists then perform some operation else exit from execution.
Korn shell
----------------------------------
array=($inputdir/abc*.dat)
If ] ]
then
echo " file exits"
else
echo " file does... (10 Replies)
Discussion started by: Rajesh123
10 Replies
LEARN ABOUT OPENSOLARIS
xdg-user-dir
xdg-user-dir(1) User Commands xdg-user-dir(1)NAME
xdg-user-dir - Get the path used for desktop user directory location.
SYNOPSIS
xdg-user-dir DIR
DESCRIPTION
xdg-user-dir is a utility that extracts the location of the specified desktop user directory from the file :
${HOME}/.config/user-dirs.dirs
OPERANDS
Valid desktop directories (DIR) are:
DESKTOP
DOWNLOAD
TEMPLATES
PUBLICSHARE
DOCUMENTS
MUSIC
PICTURES
VIDEOS
If an invalid directory is requested ${HOME} is returned.
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables:
HOME.
Other environment variable that are used are:
XDG_CONFIG_HOME
Base directory for storge of XDG configuration files. Defaults to ${HOME}/.config
FILES
The following files are used by this application:
/usr/bin/xdg-user-dir
XDG Directory expansion utility.
${XDG_CONFIG_HOME}/user-dirs.dirs
Location of the user-specific configuration including the current list of directories and what they map to.
EXAMPLES
Example 1: Location of user's documents directory
% xdg-user-dir DOCUMENTS
/home/user/Documents
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWxdg-user-dirs |
+-----------------------------+-----------------------------+
|Interface stability |Uncommitted |
+-----------------------------+-----------------------------+
SEE ALSO
More information can be found at:
http://www.freedesktop.org/wiki/Software/xdg-user-dirs
xdg-user-dirs-update(1), xdg-user-dirs-gtk-update(1), attributes(5)NOTES
Written by Darren Kenny, Sun Microsystems Inc, 2008
SunOS 5.11 03 Apr 2008 xdg-user-dir(1)