[SOLVED] SHELL. How to detect the terminal type used in linux/unix? Eg, bash, szh... or unix/linux distros | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 6

[SOLVED] SHELL. How to detect the terminal type used in linux/unix? Eg, bash, szh... or unix/linux distros

I want to learn do shell scripts compatible with all varieties OS unix/linux distros. And detecting on which distro/arch are executed? I'm developing a script to automatize apps update that don't have canonical repositories or snaps, so I need to download the package using wget. But this package have a bunch of compilations: deb, rpm.... x64, 32bits... Could be extracted from SO properties? Now, I code it for Ubuntu 20.x. The secons part is know which command need to fire unnatended install for each SO: dpkg, sudo apt...? Thanks

7th Nov 2020, 1:41 AM
David Ordás
David Ordás - avatar
4 ответов
+ 8
echo "$SHELL" see this for more similar commands👇 https://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html
7th Nov 2020, 1:51 AM
Arsenic
Arsenic - avatar
+ 3
I updated the description to clarify...
7th Nov 2020, 2:09 AM
David Ordás
David Ordás - avatar
+ 1
Thanks Martin Taylor . You are awesome!!!
7th Nov 2020, 2:09 PM
David Ordás
David Ordás - avatar
0
Martin Taylor then if for example i'm in a file with bash shellbang header and i want to continue invoke others script i can use $SHELL [file] ?
7th Nov 2020, 7:39 AM
David Ordás
David Ordás - avatar