uco
asked on
Unix Script
Hi
i want a unix script which looks for files wix%.csv . if files exist it should create
a file list.txt with file names . If no files exist it should create a dummy file named wix%.csv and create list.txt with the dummy file name
thanks
i want a unix script which looks for files wix%.csv . if files exist it should create
a file list.txt with file names . If no files exist it should create a dummy file named wix%.csv and create list.txt with the dummy file name
thanks
find / -name "^wix*\.csv" >> list.txt
The creation for the files you have to define where and under what conditions it should create an empty file.
The creation for the files you have to define where and under what conditions it should create an empty file.
you can
touch wix%.csv
to create a dummy file
If the file already exists, it is not created, so you can just always do it before you start (unless you need to preserve its modification and access times)
But where would you want to create it?
Under / ?
under all directories?
(it probably wouldn't make much sense to create one under /dev)
touch wix%.csv
to create a dummy file
If the file already exists, it is not created, so you can just always do it before you start (unless you need to preserve its modification and access times)
But where would you want to create it?
Under / ?
under all directories?
(it probably wouldn't make much sense to create one under /dev)
>If no files exist it should create a dummy file named wix%.csv and create list.txt with the dummy file name
what should the dummy file name be?
what should the dummy file name be?
ASKER
thanks for the replies
I am looking for multiple files with names wix*.csv in the same directory (dev)
Empty file need to be created if no files exist with the name wix*.csv, empty to be created int he same directory (dev)
the dummy file name should be starting with 'wix' could have anything after wix , file extension should be csv
thanks
I am looking for multiple files with names wix*.csv in the same directory (dev)
Empty file need to be created if no files exist with the name wix*.csv, empty to be created int he same directory (dev)
the dummy file name should be starting with 'wix' could have anything after wix , file extension should be csv
thanks
What, exactly is the question you are asking?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Or did you mean any file matching wix*.csv in the current working directory?