Search Results

Search: Posts Made By: cc_at_work
59,235
Posted By frans
Why store it? (but it's preferable to store the...
Why store it? (but it's preferable to store the date string to avoid calls to date in the iteration.
#!/bin/bash
D=$(date +%d-%m-%Y)
for F in *.*
do
mv $F ${F%.*}-$D.${F##*.}"
done
59,235
Posted By michaelrozar17
Store the file's extension in a variable before...
Store the file's extension in a variable before mv command and substitute in the variable later while using mv command.

#!/bin/bash

thetime=`date +%Y-%m-%d--%H:%M:%S` #
for i in *.*
do ...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 10:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy