Josif_tepe

Untitled

Jan 21st, 2026
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. for file in *.txt
  3. do
  4.     if [ -e "$file" ]; then
  5.         newname="${file%.txt}.bat"
  6.  
  7.         echo "Renaming $file to $newname"
  8.         mv "$file" "$newname"
  9.    
  10.     else
  11.         echo "No .txt files found!"
  12.     fi
  13. done
Advertisement
Add Comment
Please, Sign In to add comment