Trickle is a bandwidth limiting program. I have the following script for trickle.

echo $PATH
trickle -s -t 3 -u 200 -d 200 "$@"

I have a script in ~/bin/ that want to run the script with. I

$ my_trickle.sh new_script.sh
trickle: exec(): No such file or directory

It works if I run my_trickle.sh ~/bin/new_script.sh

Why isn't trickle recognizing the $PATH correctly? Can I get it to locate new_script.sh located in ~/bin/?

  • 1
    The ~ character is expanded to be your home directory in certain contexts; occurrences in the middle of a shell variable's contents is not one of them. In whatever init file sets and exports PATH, replace that ~/bin with $HOME/bin – Mark Plotnick Feb 10 '14 at 9:32
  • @Mark Plotnick Hey, that fixed it. I changed ~/bin to $HOME/bin in my bashrc file. Cheers. – Rucent88 Feb 10 '14 at 9:54
  • @MarkPlotnick or Rucent88 could one of you post that as an answer please? – terdon Feb 10 '14 at 16:04
  • Done. Also, correction to my comment: ~ will be expanded if it's right after an unquoted colon and the contents are being used in an assignment. So maybe the PATH assignment in bashrc used quotes. In any case, $HOME will be expanded even when it's inside double quotes. – Mark Plotnick Feb 10 '14 at 16:38

According to the shell standards document, tilde expansion is supposed to take place when a shell variable is assigned if the tilde is at the beginning of a word or follows an unquoted colon.

So it's a bit unusual for a raw tilde to wind up in the middle of your PATH variable:


But it is there, and the shell is not going to expand it to be your home directory when it looks through PATH to find an executable.

The easiest fix is to change ~ to $HOME in whatever init file sets PATH. I'd guess there are some double quotes in that statement that are preventing ~ from getting expanded.


Change ~/bin to $HOME/bin the file that sets $PATH.

Probably your ~/.bashrc or ~/.profile

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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