---
title: "JOPLIN : Script to rename tacitpart file"
url: https://www.cyber-neurones.org/2019/11/joplin-script-to-rename-tacitpart-file/
date: 2019-11-23
modified: 2019-11-23
author: "Frederic"
description: "My script to rename tacitpart file : #!/bin/bash # ARIAS Frederic # # For MAC OS do # suffix=\".tacitpart\" path=\"WebDAV\" for file in $path/*.tacitpart do if [[ -f $file ]];..."
categories:
  - "Stockage"
tags:
  - "Joplin"
word_count: 71
---

# JOPLIN : Script to rename tacitpart file

My script to rename tacitpart file :
#!/bin/bash

# ARIAS Frederic
#
# For MAC OS do
#

suffix=".tacitpart"
path="WebDAV"

for file in $path/*.tacitpart
do
if [[ -f $file ]]; then
filenew=$(basename $file $suffix)
echo $file" -> "$filenew
mv $file $path/$filenew
touch $path/$filenew
fi
done

#
for file in $path/.resource/*.tacitpart
do
if [[ -f $file ]]; then
$filenew = ${file/%$suffix}
echo $file." -> ".$filenew
mv $file $path/.resource/$filenew
touch $path/.resource/$filenew
fi
done