Off-Topic > Off-Topic - Tiny Core Lounge
[Solved] whichcraft
Leee:
I'm putting this in "Off-Topic" because I'm not sure if it's a base issue, an extension issue or a pebcak issue but here's the story. If anyone can tell me what's up, or just that I need more sleep, I'd appreciate it.
I'm running Core 15.0 / x86_64 on one of my many decrepit old laptops and putting together a suite if system info scripts including neofetch. This particular box is on both the wired and wireless subnets but neofetch only shows one of them (the wifi) so I decided to hack it to show both. But, in the process of hacking it, I ran into what appears to me to be a system issue.
The original neofetch script is mount-installed in the usual manner:
--- Code: ---tc@gramlt:~/.config/neofetch$ ls -l /usr/local/bin/neofetch
lrwxrwxrwx 1 root root 43 Jan 17 00:52 /usr/local/bin/neofetch -> /tmp/tcloop/neofetch/usr/local/bin/neofetch
--- End code ---
My gently hacked copy is in my personal bin directory:
--- Code: ---tc@gramlt:~/.config/neofetch$ ls -l ~/bin/neofetch
-rwxr--r-- 1 tc staff 334829 Jan 17 13:24 /home/tc/bin/neofetch
--- End code ---
My PATH includes my personal bin directory first:
--- Code: ---tc@gramlt:~/.config/neofetch$ echo "${PATH}" |tr ":" "\n"
/home/tc/bin
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
--- End code ---
The only aliases in play are the default ones:
--- Code: ---tc@gramlt:~/.config/neofetch$ alias
ls='ls -p'
cp='cp -i'
df='df -h'
rm='rm -i'
mv='mv -i'
la='ls -la'
du='du -h'
ce='cd /etc/sysconfig/tcedir'
ll='ls -l'
--- End code ---
The which command tells me just what I'd expect:
--- Code: ---tc@gramlt:~/.config/neofetch$ which neofetch
/home/tc/bin/neofetch
--- End code ---
However, when I invoke neofetch by simply naming it, the original (in /usr/local/bin ) runs. Note the "Script Name" line, which outputs ${0}:
--- Code: ---tc@gramlt:~/.config/neofetch$ neofetch
0000 Script Name: /usr/local/bin/neofetch
00 Which Script: /home/tc/bin/neofetch
00 00 Host: gramlt
00 00 0000 Model: HP 2000 Notebook PC 0889130000305910000620100
00 OS: TinyCoreLinux 15.0 x86_64
0000 Kernel: 6.6.8-tinycore64
00 0000 Uptime: 2 days, 17 hours, 42 mins
00 00 00 Packages: 233 (tce-status)
00 00 00 Shell: sh
00 00 00 Resolution: , 1920x1080
00 00 00 WM: JWM
00 00 00 Terminal: /dev/pts/0
00 CPU: AMD A6-5200 APU (4) @ 2.000GHz
00 00 00 (°- GPU: AMD ATI Radeon HD 8400 / R3 Series
0000 00 //\ Memory: 365MiB / 7433MiB
00 0000 0000 v_/_ Disk (/mnt/sda1): 11G / 92G (13%)
tce dir: /mnt/sda1/boot/core15.0/tce64
Local IP: 10.0.0.156
--- End code ---
When I invoke neofetch the way "which" thinks it should be invoked, the hacked script (in /home/tc/bin/ ) runs. Again, note the "Script Name" line:
--- Code: ---tc@gramlt:~/.config/neofetch$ which neofetch
/home/tc/bin/neofetch
tc@gramlt:~/.config/neofetch$
tc@gramlt:~/.config/neofetch$ `which neofetch`
0000 Script Name: /home/tc/bin/neofetch
00 Which Script: /home/tc/bin/neofetch
00 00 Host: gramlt
00 00 0000 Model: HP 2000 Notebook PC 0889130000305910000620100
00 OS: TinyCoreLinux 15.0 x86_64
0000 Kernel: 6.6.8-tinycore64
00 0000 Uptime: 2 days, 17 hours, 50 mins
00 00 00 Packages: 233 (tce-status)
00 00 00 Shell: sh
00 00 00 Resolution: , 1920x1080
00 00 00 WM: JWM
00 00 00 Terminal: /dev/pts/0
00 CPU: AMD A6-5200 APU (4) @ 2.000GHz
00 00 00 (°- GPU: AMD ATI Radeon HD 8400 / R3 Series
0000 00 //\ Memory: 364MiB / 7433MiB
00 0000 0000 v_/_ Disk (/mnt/sda1): 11G / 92G (13%)
tce dir: /mnt/sda1/boot/core15.0/tce64
Local IP: 192.168.1.100 - and - 10.0.0.156
--- End code ---
In the grand scheme of things, I'm thinking I can probably just hack the config file ( ~/.config/neofetch/config.conf ) instead of the main script.
But, in the even grander scheme of things, WTF?!?
For anyone who is interested, attached is the TinyCore logo file that I had to make for myself, since TinyCore is not one of the -many- little known distros for which neofetch has built in logos.
ovacikar:
Did you try:
--- Code: ---hash -r
--- End code ---
Rich:
Hi Leee
ovacikar is correct. I just ran into that same issue (again) the
other day. Sometimes after loading an extension, the terminal
you are using isn't aware of the change.
Either running:
--- Code: ---hash -r
--- End code ---
or launching a new terminal should fix it.
Leee:
--- Quote from: Rich on January 17, 2025, 02:54:16 PM ---Hi Leee
ovacikar is correct. I just ran into that same issue (again) the
other day. Sometimes after loading an extension, the terminal
you are using isn't aware of the change.
Either running:
--- Code: ---hash -r
--- End code ---
or launching a new terminal should fix it.
--- End quote ---
Thanks @ovacikar and @rich !
That apparently was exactly the issue. I tried opening a new terminal and it worked correctly. Then went back to the original terminal and tested it before and after running
--- Code: ---hash -r
--- End code ---
and it worked the wrong way before and the correct way afterward.
I've never used the hash command before - sounds like it should have something to do with substance abuse. :)
In the mean time, I moved my changes to the neofetch config file and can now throw away the modified neofetch anyway. Still, I've learned something so my day is complete.
Leee:
@rich I've forgotten how to mark the issue as "solved".
Navigation
[0] Message Index
[#] Next page
Go to full version