Tiny Core Linux

General TC => Programming & Scripting - Unofficial => Topic started by: Sashank999 on July 26, 2020, 10:26:49 PM

Title: [Solved] Shell Script "mv" error
Post by: Sashank999 on July 26, 2020, 10:26:49 PM
Hi

I am actually having an error in my script in moving .tcz.list file from /tmp/infocreator to PWD.

Error :
Code: [Select]
mv: 'python3.6-urwid.tcz.list' and '/tmp/infocreator/python3.6-urwid.tcz.list' are the same file
Code :
Code: [Select]
PWD=$(pwd)
cp "$FILE".tcz /tmp/infocreator/
cd /tmp/infocreator
unsquashfs "$FILE".tcz &> /dev/null
sudo find ./squashfs-root -not -type d | sed 's,./squashfs-root/,/,' | tee "$FILE".tcz.list &> /dev/null
sudo rm -rf squashfs-root
mv "$FILE".tcz.list "$PWD"/
cd "$PWD"
Any ideas what to do ?
Thanks in advance.
Title: Re: Shell Script "mv" error
Post by: Rich on July 26, 2020, 10:37:13 PM
Hi Sashank999
Does it work any better if you rename the variable from  PWD  to  OldDir ?
Title: Re: Shell Script "mv" error
Post by: Sashank999 on July 27, 2020, 05:01:46 AM
Thank You Rich. That worked. This could be marked as solved  :D .
Title: Re: [Solved] Shell Script "mv" error
Post by: Rich on July 27, 2020, 03:41:14 PM
Hi Sashank999
You are welcome. Next time run:
Code: [Select]
envIf any of the variables you defined shows up on that list, pick a new name.
Title: Re: [Solved] Shell Script "mv" error
Post by: Sashank999 on July 27, 2020, 10:47:11 PM
Thanks for the suggestion.