#How can I quickly determine if a variable has been assigned a path without my specification?

128 messages · Page 1 of 1 (latest)

ocean sorrel
#

I've checked /etc/profile, /etc/profile.d/, ~/.bash_profile, bashrc, bash_profile, .profile but springboot is still being pathed without me explicitly pathing it.

honest forum
#

Have you checked:

  • /etc/environment
  • /etc/security/pam_env.conf
  • ~/.config/environment.d/

But you can also use ripgrep to quickly search for all text files containing PATH=, or your actual path.

Eg:

rg -g '!/proc' -g '!/sys' -g '!/dev' -g '!/tmp' -g '!/usr/*' -g '!/opt' -g '!/var/lib' --no-follow '\bPATH=' / 2>/dev/null

or

rg -g '!/proc' -g '!/sys' -g '!/dev' -g '!/tmp' -g '!/usr/*' -g '!/opt' -g '!/var/lib' --no-follow '\.local/bin\b' / 2>/dev/null

Where .local/bin is the path I'm looking for. Uses standard regex rules btw.

#

-g '!path' is to exclude a path from your searching, to speed up searches. Feel free to exclude more paths specific to you, such as /mnt etc

ocean sorrel
#

Ill do all this rn and send screenshots ❤️

#
etc/enviroment
#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#

export VDPAU_DRIVER=nvidia
export LIBVA_DRIVER_NAME=vdpau
#

/etc/security/pam_env.conf

#

i dont have an enviroment.d

#

outputs of commands

#

└──>>find / -type d -name "Spring" 2>/dev/null
/home/khalidwaleedkhedr/SpringBoot
/home/khalidwaleedkhedr/.cache/JetBrains/IdeaIC2023.1/vcs-log/Springb_9fbc23f1_bae096b4
/home/khalidwaleedkhedr/.cache/JetBrains/IdeaIC2023.1/compile-server/springboot_app_7c80e887/targets/java-production/Springboot_App_2a1e7100
/home/khalidwaleedkhedr/.cache/JetBrains/IdeaIC2023.1/compile-server/springboot_app_7c80e887/targets/resources-production/Springboot_App_2a1e7100
/home/khalidwaleedkhedr/.cache/JetBrains/IdeaIC2023.1/compile-server/springboot_app_7c80e887/targets/maven-annotations-production/Springboot_App_2a1e7100
/home/khalidwaleedkhedr/.cache/JetBrains/IdeaIC2023.1/frameworks/detection/Springboot App.9fbc23f1
/home/khalidwaleedkhedr/.cache/JetBrains/IdeaIC2023.3/frameworks/detection/SpringbootProject.78a8b23b
┌─[15:56:41]──[khalidwaleedkhedr]──[KhalidComputer]:$~$
└──>>
output of find / -type d -name "Spring" 2>/dev/null

sage bladeBOT
#

Crows
Compile Error! Click the errors reaction for more information.
(You may edit your message to recompile.)

honest forum
#

Type which springboot

ocean sorrel
#

which Spring
which: no Spring in (/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/android-sdk/cmdline-tools/latest/bin:/home/khalidwaleedkhedr/.spicetify:/home/khalidwaleedkhedr/.local/bin:/home/khalidwaleedkhedr/SpringBoot/bin:/home/khalidwaleedkhedr/.local/share/JetBrains/Toolbox/scripts:/var/lib/snapd/snap/bin)

#

but Spring is working

honest forum
#

What's the actual executable called?

ocean sorrel
#

the command is Spring

#

the path to it is ~/SpringBoot/bin

#

it's recongized in my paths but i never put it in my bashrc

honest forum
#

and if you type 'Spring' in the terminal, it launches?

ocean sorrel
#

yes

#

but idk how it exists in my paths if it isnt declared

#

ill share my bashrc

honest forum
#

Could be a bash function or alias then

ocean sorrel
#

my apologies for all the spam

#

i spent hours trying to understand

#

and im keeping documentation for anyone who wants to help

#

i can share my other .bash files

honest forum
#

Yep.

ocean sorrel
#

want me to share them?

#
#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc

if [[ "$(tty)" = "/dev/tty1" ]]; then
   pgrep i3 || startx "~/.config/X11/xinitrc"
fi


#
#!/bin/sh

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then







    xrdb -merge $sysresources

fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then







    xrdb -merge "$userresources"

fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

# start some nice programs

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

picom &
exec i3

#

my .profile is empty

#
which Springboot
which: no Springboot in (/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/android-sdk/cmdline-tools/latest/bin:/home/khalidwaleedkhedr/.spicetify:/home/khalidwaleedkhedr/.local/bin:/home/khalidwaleedkhedr/SpringBoot/bin:/home/khalidwaleedkhedr/.local/share/JetBrains/Toolbox/scripts:/var/lib/snapd/snap/bin)
#
find / -type d -name "*Spring*" 2>/dev/null
/home/khalidwaleedkhedr/SpringBoot
/home/khalidwaleedkhedr/.cache/JetBrains/IdeaIC2023.1/vcs-log/Springb_9fbc23f1_bae096b4
/home/khalidwaleedkhedr/.cache/JetBrains/IdeaIC2023.1/compile-server/springboot_app_7c80e887/targets/java-production/Springboot_App_2a1e7100
/home/khalidwaleedkhedr/.cache/JetBrains/IdeaIC2023.1/compile-server/springboot_app_7c80e887/targets/resources-production/Springboot_App_2a1e7100
/home/khalidwaleedkhedr/.cache/JetBrains/IdeaIC2023.1/compile-server/spring
boot_app_7c80e887/targets/maven-annotations-production/Springboot_App_2a1e7100
/home/khalidwaleedkhedr/.cache/JetBrains/IdeaIC2023.1/frameworks/detection/Springboot App.9fbc23f1
/home/khalidwaleedkhedr/.cache/JetBrains/IdeaIC2023.3/frameworks/detection/SpringbootProject.78a8b23b
#

all instances of Spring ^

honest forum
#

Run this:

rg -g '!/proc' -g '!/sys' -g '!/dev' -g '!/tmp' -g '!/usr/*' -g '!/opt' -g '!/var/lib' --no-follow 'SpringBoot/bin\b' / 2>/dev/null

ocean sorrel
#

blank

honest forum
#

Could try temporarily renaming the ~SpringBoot/bin folder to say bin.bak or something. Then reboot and check the journalctl logs for any errors, that way it would show which program it was that tried to interact with that path. And we can proceed from there.

ocean sorrel
#

will do that now

#

i appreciate your support and help, again my apologies for being overly spammy

honest forum
#

No worries

ocean sorrel
#

will reboot rn

#

want me to do journalctl

honest forum
#

Yep

ocean sorrel
#

any specific command? i can journalctl -p err and journalctl -p err | grep -iE 'file not found|permission denied|file system error'

honest forum
#

Yep. Could also grep for SpringBoot

ocean sorrel
#

nothing lol

sage bladeBOT
#

Crows
Compile Error! Click the errors reaction for more information.
(You may edit your message to recompile.)

ocean sorrel
#
└──>>journalctl -p err
Feb 29 16:12:40 KhalidComputer kernel: integrity: Problem loading X.509 certificate -65
Feb 29 16:12:44 KhalidComputer kernel: amdgpu 0000:06:00.0: amdgpu: Secure display: Generic Failure.
Feb 29 16:12:44 KhalidComputer kernel: amdgpu 0000:06:00.0: amdgpu: SECUREDISPLAY: query securedisplay TA failed. ret 0x0
Feb 29 16:12:45 KhalidComputer bluetoothd[594]: src/adapter.c:reset_adv_monitors_complete() Failed to reset Adv Monitors: Failed (0x03)
Feb 29 16:12:45 KhalidComputer bluetoothd[594]: Failed to clear UUIDs: Failed (0x03)
Feb 29 16:12:46 KhalidComputer kernel: 
┌─[16:14:07]──[khalidwaleedkhedr]──[KhalidComputer]:$~$
└──>>journalctl -p err | grep -iE 'file not found|permission denied|file system error'
┌─[16:14:52]──[khalidwaleedkhedr]──[KhalidComputer]:$~$
└──>>journalctl | grep springboot
┌─[16:16:22]──[khalidwaleedkhedr]──[KhalidComputer]:$~$
└──>>
honest forum
#

How about Spring?

ocean sorrel
#

nothing

honest forum
#

And don't forget to use -i for case insensitive match

ocean sorrel
#
└──>>journalctl | grep Spring
┌─[16:17:18]──[khalidwaleedkhedr]──[KhalidComputer]:$~$
└──>>journalctl | grep -i Spring    
┌─[16:18:00]──[khalidwaleedkhedr]──[KhalidComputer]:$~$
└──>>
#

└──>>echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/android-sdk/cmdline-tools/latest/bin:/home/khalidwaleedkhedr/.spicetify:/home/khalidwaleedkhedr/.local/bin:/home/khalidwaleedkhedr/SpringBoot/bin:/home/khalidwaleedkhedr/.local/share/JetBrains/Toolbox/scripts:/var/lib/snapd/snap/bin

#

somehow still in my path

#

think my laptop is cursed and needs to be thrown into mount doom ngl

honest forum
#

And are you sure you're only using bash? Not zsh or fish or something like that?

ocean sorrel
#

i have zsh

honest forum
#

Is that what you're typing those commands on?

ocean sorrel
#

this is my .zshc

#

and that's all i have

honest forum
#

How about ~/.zshenv, ~/.zprofile, and ~/.zlogin

ocean sorrel
#

i gives u my secrets

honest forum
#

Can you try running bash directly? Like configure some terminal (Konsole or something) to launch bash as the startup command

#

And check your PATH there

ocean sorrel
#

sure!

#

lemme figure out how to do that

#

i am dumb

#

sorry its taking a bit

honest forum
#

np

ocean sorrel
#

ok

#

i think i did it

honest forum
#

You're in bash now?

ocean sorrel
#

shell /bin/bash i added this to my kitty conf

#

~/.config/kitty/kitty.conf

#

echo $SHELL returns bin/bash and echo $PATH still shows me Spring despite ~/SpringBoot/bin.bak

honest forum
#

Can you run echo $0

ocean sorrel
honest forum
#

Can you also run ps -p $PPID -o comm=

ocean sorrel
#

returns kitty

#

do u want an image for proof or are you ok with me telling you that

honest forum
#

Nah all good

#

Just wanted to check that it's running bash directly

ocean sorrel
#

i switched to kde to make it easier lol

honest forum
#

and seems like there's nothing special in your kitty.conf either

ocean sorrel
#

ye

#

im probably overreacting

#

but im just worried for future stuff if pathing springboot is gunna cause depedency issues

#

or instability issues

#

i just dont get it

honest forum
#

Well you can always rename the folder unless something needs that folder to be called exactly that

ocean sorrel
#

dont understand why it's still pathing

honest forum
#

At this point I'm outta ideas lol

ocean sorrel
#

Spring isnt working since i renamed it

#

bin.bak

#

still pathed as /bin

#

fixed the name and spring works again

honest forum
#

Not really familiar with Spring sorry so can't help you with that but normally you'd want to use a dev container to avoid issues like this

ocean sorrel
#

i could have used dockers but im not that profecient at coding youre correct

#

ill maintain what i have; my only last resort is it has something to do with a startup application like jetbrains toolbox

#

but i dont wish to go through the rabbithole of checking every application on start

#

regardless; i appreciate your time and professionalism truly.

#

you were helpful and i learned a lot

honest forum
#

All good, but seriously you should check out containers, they're there to deal exactly with issues like these, and they make development a lot more easier.

ocean sorrel
#

i am doing that as we speak

#

this whole endevour was for me to learn springboot since im looking for work

#

im a newly graduate that earned my second degree

honest forum
#

Ah OK

ocean sorrel
#

and then this wasted my day

honest forum
#

Nah, you learnt some things so I wouldn't call it a waste. 🙂

#

It's all part of the experience. 🙂

ocean sorrel
#

❤️ i like u btw ur cool

#

k ill leave ya to do cool things ty 4 help

honest forum
#

Cool, all the best!

ocean sorrel
honest forum
ocean sorrel
#

it was because of a script i wrote aeons ago

#

that made all paths public

#

in my etc/profile.d