Search This Blog

Saturday, March 6, 2021

Shell script to move all files , if they are exists if not do nothing

 

Script - 

#!/bin/bash


for files in *.txt; do

        if [ -f "$files" ] # does file exist?

        then

               mv "$files"  

/data/archive/"${files%.txt}"_$timestamp.txt

                else

                        echo "No files"

        fi

done

No comments:

Post a Comment

Transportable tablespace refresh

  1.check tablespace for the user which need to refresh -------------------------------------------------------------------  SQL> select ...