Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTilde character in file path in a shell must expand to the absolute path of the home directory #4244
Comments
This comment has been minimized.
This comment has been minimized.
|
Tilde expansion is the responsibility of your shell on Unix. Which shell are you using? If your shell doesn't support it, |
This comment has been minimized.
This comment has been minimized.
It is not mentioned in the documents, but the './prometheus --configfile= ..' needs to be executed as root user. In my scenario; I extracted prometheus into normal user's directory '~asathe/prometheus'. In the scenario; 'prometheus' directory is present inside the home directory root user; $HOME gets expanded to its value ( /root ) in the following command: |
This comment has been minimized.
This comment has been minimized.
It sounds like you've been using |
This comment has been minimized.
This comment has been minimized.
|
I just tried and ~ doesn't expand for me either.
|
This comment has been minimized.
This comment has been minimized.
|
@amej do you think you can try to find the cause and open a PR? |
This comment has been minimized.
This comment has been minimized.
|
on a second thought @amej do you have any immediate use for that? unless it is trivial change and someone really needs this maybe not worth adding any extra code for this. I usually use relative paths like |
krasi-georgiev
added
priority/Pmaybe
and removed
priority/P3
labels
Jun 8, 2018
This comment has been minimized.
This comment has been minimized.
|
don't think we have an immediate need for this so will revisit if needed. feel free to reopen if you have a good use case that requires this. |
krasi-georgiev
closed this
Jun 11, 2018
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 22, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
amej commentedJun 8, 2018
Proposal
** Tilde symbol in a file path needs to expand to absolute path of home directory of the user as per the *nix **
Bug Report
What did you do?
As per instructions given in https://prometheus.io/docs/introduction/first_steps/; start prometheus by executing
./prometheus --config.file=~asathe/prometheus-2.3.0.linux-amd64/prometheus.ymlWhat did you expect to see?
In the ~asathe/prometheus-2.3.0.linux-amd64/prometheus.yml ; I expected the ~asathe to expand to home directory of asathe ( in my case; it is /home/pnq/asathe )
What did you see instead? Under which circumstances?
prometheus reported
level=error ts=2018-06-08T13:41:36.291212386Z caller=main.go:597 err="Error loading config couldn't load configuration (--config.file=~asathe/prometheus-2.3.0.linux-amd64/prometheus.yml): open ~asathe/prometheus-2.3.0.linux-amd64/prometheus.yml: no such file or directory"Environment
Linux 4.14.16-300.fc27.x86_64 x86_64 ```