Похожие чаты

Guys... (👋 Martin 😅) I have a little bit of a

dilemma by my hands, one of which I don't even know how to prhase it out to ask it to our God Father Google:
how do I source a file in bash based on the sourcing script and not the relative path of the shell prompt at that specific time?

I'll explain myself a little bit better:
I have this directory structure
/home/bryanpedini/projects/personal-linux-config
├── bashrc_overrides
│ ├── _all
│ ├── colored_commands
│ ├── convenience_aliases
│ ├── git_functions
│ ├── histcontrol
│ ├── home_bin_folder
│ ├── ls_aliases
│ ├── safety_aliases
│ ├── terminal_colors
│ ├── terminal_fancyfying
│ └── terminal_fancyfying_server
├── deploy.sh
├── LICENSE
└── README.md

I would like the _all file to source the other files, the issue is that I would have to source based on the current path of the _all file and not the path where my prompt is at that time (could be ~, could be /, could be whatever)
also, this, because I need the ability to move the directory from /home/bryanpedini..... to /path/to/whatever and just update the reference to the _all file in ~/.bashrc and not every reference of every file...

3 ответов

23 просмотра

Isn't it easier to just get the path to the _all script? There's a one-liner for that https://stackoverflow.com/questions/59895/how-can-i-get-the-source-directory-of-a-bash-script-from-within-the-script-itsel

Bryan Joshua-Pedini Автор вопроса
Bryan Joshua-Pedini Автор вопроса
Pedro Aguiar
Isn't it easier to just get the path to the _all s...

actually, I'm wrong, the thing I use in the deploy.sh script (which is SCRIPT_DIR="$(dirname "$(readlink -fm "$0")")" to be precise) doesn't work, this solution did...

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта