0

I have a script that simply downloads a package, installs it, then it shoots the "process.desktop" to ~/.config/autostart to add it to XFCE's startup processes.

Everything works but moving the process.desktop to ~/.config/autostart/

Here is my code:

mv ~/process.desktop ~/.config/autostart/

It returns this error:

mv: cannot stat '/username/process.desktop' : No such file or directory

Note, the download goes to /home/username/ and it is installed [successfully] there. process.desktop is also in /home/username/

Thanks for any insight, this is the last component of my script I have to fix!

1
  • What is the output of echo $HOME? Is is somehow /username by accident? Aug 20, 2011 at 2:52

2 Answers 2

1

Weird - you would certainly expect ~ to expand to /home/username.

If one thing doesn't work, try another:

mv $HOME/process.desktop $HOME/.config/autostart

Question:

  • Are you sure you want to replace the existing autostart with the new file, rather than, say, adding the new file to the end of the existing autostart file?
8
  • Hi thanks for the reply, Jonathan. I am currently testing this new syntax now. Also, to answer your question, autostart is a directory. It is full of processname.desktop files.
    – bourneSH12
    Aug 20, 2011 at 2:47
  • Dang, no luck. In the terminal it calls me .desktop file "process.desktop" but in thunar, it calls Process_Start which is a title I gave it in the code...? Which should I use?
    – bourneSH12
    Aug 20, 2011 at 2:50
  • ~ should expand to the same thing as $HOME; more likely $HOME is messed up. Aug 20, 2011 at 2:54
  • oh dang, ~/.config/autostart does not exist... it's gone, out of thin air. I did ls -a and it removed itself. Is there I can add it? I'd imagine a simple if statement checking for it and if its not there adding it would work, but does that mess with the installation at all?
    – bourneSH12
    Aug 20, 2011 at 2:58
  • 1
    set -vx is the shell debugging mode. You'll see each line/block of code, then a separate set of line(s) that show how all the variables are expanded. Good luck.
    – shellter
    Aug 20, 2011 at 9:47
1

The tilde path component expands to the current value of $HOME. An example under bash:

$ echo $HOME
/home/user
$ echo ~
/home/user
$ HOME=/tmp
$ echo ~
/tmp

Have you edited the value of $HOME? Is it possible that you created this account with the wrong home directory path? You can check that by:

grep username /etc/passwd

or

finger username

If that is the case, you can fix it with the usermod command or just edit /etc/passwd directly.

sudo usermod -d /home/username username

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.