General TC > Programming & Scripting - Unofficial

[Solved] Shell Script "mv" error

(1/1)

Sashank999:
Hi

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

Error :

--- Code: ---mv: 'python3.6-urwid.tcz.list' and '/tmp/infocreator/python3.6-urwid.tcz.list' are the same file
--- End code ---

Code :

--- Code: ---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"

--- End code ---
Any ideas what to do ?
Thanks in advance.

Rich:
Hi Sashank999
Does it work any better if you rename the variable from  PWD  to  OldDir ?

Sashank999:
Thank You Rich. That worked. This could be marked as solved  :D .

Rich:
Hi Sashank999
You are welcome. Next time run:

--- Code: ---env
--- End code ---
If any of the variables you defined shows up on that list, pick a new name.

Sashank999:
Thanks for the suggestion.

Navigation

[0] Message Index

Go to full version