You are not logged in.
Does anyone know how to make this possible?
My goal is create a custom action that does this:
1 - creates a folder with the same name as the file
2 - then moves the file inside it
3 - renames the file, adding a timestamp prefix to it
example of what I'm trying to achieve
initial file:
/home/user/ABC.txt
after right-click and apply thunar custom action to ABC.txt:
/home/user/ABC/20170710-021033-ABC.txt
I already have a script that is close, but the step 3 is missing:
1 - creates a folder with the same name as the file
2 - then moves the file inside it
#!/bin/sh
set -e
for file do
case "$file" in
*/*) TMPDIR="${file%/*}"; file="${file##*/}";;
*) TMPDIR=".";;
esac
temp="$(mktemp -d)"
mv -- "$file" "$temp"
#this line removes the file extension
mv -- "$temp" "$TMPDIR/${file%.*}"
#if I want to keep the file extension, use this line instead
#mv -- "$temp" "$TMPDIR/$file"
done
Queen - Megadeth - Metallica - 80's
Offline
See if this helps: https://unix.stackexchange.com/question … -timestamp
Offline
[ Generated in 0.005 seconds, 7 queries executed - Memory usage: 522.38 KiB (Peak: 533.05 KiB) ]