libertyforall2
asked on
If /path/file1.txt has 0 data replace with /path/genericfile.txt using shell script or perl on a linux box
I'm running a matlab script at it will not create ANY graphics unless ALL of the files contain data. As a result, I need to replace files that occasionally lack to with dummy data so the remaining output graphics can be generated so I need to do this.
If /path/file1.txt has 0 data replace with /path/genericfile.txt using shell script or perl on a linux box
If /path/file1.txt has 0 data replace with /path/genericfile.txt using shell script or perl on a linux box
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Works.
[ -s /path/file1.txt ] && cp -p /path/genericfile.txt /path/file1.txt
wmp