-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun_program_localy_JBs.sh
More file actions
executable file
·47 lines (41 loc) · 1.48 KB
/
run_program_localy_JBs.sh
File metadata and controls
executable file
·47 lines (41 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
#
# Autor= João Batista Ribeiro
# Bugs, Agradecimentos, Críticas "construtivas"
# me envie um e-mail. Ficarei Grato!
# e-mail: joao42lbatista@gmail.com
#
# Este programa é um software livre; você pode redistribui-lo e/ou
# modifica-lo dentro dos termos da Licença Pública Geral GNU como
# publicada pela Fundação do Software Livre (FSF); na versão 2 da
# Licença, ou (na sua opinião) qualquer versão.
#
# Este programa é distribuído na esperança que possa ser útil,
# mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a
# qualquer MERCADO ou APLICAÇÃO EM PARTICULAR.
#
# Veja a Licença Pública Geral GNU para mais detalhes.
# Você deve ter recebido uma cópia da Licença Pública Geral GNU
# junto com este programa, se não, escreva para a Fundação do Software
#
# Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script: Run a program using $HOME in working directory ($PWD)
#
# Last update: 13/02/2026
#
set -x
HERE=$(pwd) # Here
echo -e "\nLocal place: $HERE\n"
# Folder to use as $HOME (~/)
mkdir 1_home/
# Folder to use as $XDG_CONFIG_HOME (~/.config/)
mkdir 2_config/
prog_name="$1" # Program name
remaining_args=("${@:2}") # Assign the remaining arguments
# Run the program using the new configurations folders
if [ "$remaining_args" == "" ]; then
HOME="$HERE/1_home/" XDG_CONFIG_HOME="$HERE/2_config/" "./$prog_name"
else
HOME="$HERE/1_home/" XDG_CONFIG_HOME="$HERE/2_config/" "./$prog_name" "$remaining_args"
fi