WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline Sashank999

  • Sr. Member
  • ****
  • Posts: 280
[Solved] Shell Script "mv" error
« on: July 26, 2020, 07: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, 12:37:19 PM by Rich »

Online Rich

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

Offline Sashank999

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

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 7927
Re: [Solved] Shell Script "mv" error
« Reply #3 on: July 27, 2020, 12: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: 280
Re: [Solved] Shell Script "mv" error
« Reply #4 on: July 27, 2020, 07:47:11 PM »
Thanks for the suggestion.