WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] Shell Script "mv" error  (Read 2631 times)

Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 390
[Solved] Shell Script "mv" error
« 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.
« Last Edit: July 27, 2020, 03:37:19 PM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11514
Re: Shell Script "mv" error
« Reply #1 on: July 26, 2020, 10:37:13 PM »
Hi Sashank999
Does it work any better if you rename the variable from  PWD  to  OldDir ?

Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 390
Re: Shell Script "mv" error
« Reply #2 on: July 27, 2020, 05:01:46 AM »
Thank You Rich. That worked. This could be marked as solved  :D .

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11514
Re: [Solved] Shell Script "mv" error
« Reply #3 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.

Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 390
Re: [Solved] Shell Script "mv" error
« Reply #4 on: July 27, 2020, 10:47:11 PM »
Thanks for the suggestion.