source

How does KD acronym unveils? /usr/include/linux/kd.h

How does KD acronym unveils? /usr/include/linux/kd.h I do understand that it is related to console (a "real" TTY which is at Ctrl+Alt+F[1-9]). ioctl_console man page lists many KD* prefixed constants. there is also a vt.h in /usr/include/linux which is easy – a VT – virtual terminal or a pseudo-terminal. What a heck is KD? Asked …

Total answers: 1

If I have two versions of python3 installed on my machine (ie: 3.11.2 and 3.12), how do I set the default version to use when running python scripts?

If I have two versions of python3 installed on my machine (ie: 3.11.2 and 3.12), how do I set the default version to use when running python scripts? I installed the earlier version (3.11.2) normally using apt package manager and the later version (3.12) manually from source. When I execute python scripts like so: ./python_script.py …

Total answers: 4

How to list packages that have been installed from source in Linux?

How to list packages that have been installed from source in Linux? I usually use package managers like apt to install packages and then use dpkg to list the packages, that I have installed. Is there any way to get a similar list if I install from source? I saw an answer that states that, …

Total answers: 1

Changing yum source through Gnome GUI

Changing yum source through Gnome GUI This might be a silly question, but it puzzles me. I am using Rocky linux version 9.2. I wonder if there is a way to change the yum install source through gnome gui? that is, without using command line, just the mouse. I know how to do similar setting …

Total answers: 1

How to "source ~/.bashrc" automatically when connect to remote

How to "source ~/.bashrc" automatically when connect to remote I need to create some aliases on remote Ubuntu and enable them on ssh-connection. So I defined aliases in ~/.bashrc file (on that remote Ubuntu). Now when I do ssh root@<Remote IP> source ~/.bashrc I can use those aliases… But instead of do source ~/.bashrc manually …

Total answers: 1

Why the struct lsm_id is not present in linux kernel source tree

Why the struct lsm_id is not present in linux kernel source tree I am writing an LSM, and I am compiling it using my kernel 6.2.0-20-generic. When I browse the files in /lib/modules/6.2.0-20-generic/build, I can see that there is a struct named lsm_id. But When I examine the recent Linux source tree in Github, I …

Total answers: 1

Commands cannot be located after sourcing a bash script

Commands cannot be located after sourcing a bash script I have a short bash script cdline that takes two arguments PATHS and LINE and changes directory to the respective LINE in PATHS: #!/bin/bash #command for changing directory to that in the given line… #or that of the file in the given line PATHS=$1 LINE=$2 PATH="$(echo …

Total answers: 2

Decanting code in $HOME/.bashrc into a function

Decanting code in $HOME/.bashrc into a function I have the following code fragment in my $HOME/.bashrc file: export RED=’e[0;31m’ export GREEN=’e[0;32m’ export YELLOW=’e[0;33m’ export BLUE=’e[0;34m’ export MAGENTA=’e[0;35m’ export CYAN=’e[0;36m’ export WHITE=’e[0;37m’ # export BOLD_RED=’e[1;31m’ export BOLD_GREEN=’e[1;32m’ export BOLD_YELLOW=’e[1;33m’ export BOLD_BLUE=’e[1;34m’ export BOLD_MAGENTA=’e[1;35m’ export BOLD_CYAN=’e[1;36m’ export BOLD_WHITE=’e[1;37m’ # export BLACK=’e[30′ export RESET_COLOR=’e[m’ export RESET_TERMINAL_COLOR="tput sgr0" I …

Total answers: 1

Load variables with source with a single line scope

Load variables with source with a single line scope In bash and other shells, I can make same variables have "line scope" by defining it just before a command. CXX=clang++ ./script.bash Which I prefer over export CXX=clang++ ./script.bash because the former doesn’t contaminate the environment. How can I do the same with variables set by …

Total answers: 1

Use shell script function directly on bash

Use shell script function directly on bash I have a utilitarian shell script full of goodies and wish to bring them to the bash environment. I used the command source before as analogous to import or include in other languages. printer.sh #!/bin/bash printAwesome () { echo "Awesome!" } printMoo () { echo "Moo!" } I …

Total answers: 1

Differences between using source and ./ a .sh file

Differences between using source and ./ a .sh file I know the above topic has been discussed before source a .sh file and you retain the environmental variables after you are done with the sh file while ./ a .sh file and you lose the environmental variables after you are done However, I have the …

Total answers: 1

Why are there pre-compiled packages in repositories?

Why are there pre-compiled packages in repositories? I love (the way) how Linux & Co. lets users install many packages from different repositories. AFAIK, they come also with source-packages, so you can compile them by yourself. But why even bother to "keep/offer" pre-compiled packages, when you could just compile them yourself? What are the intentions …

Total answers: 5

Source of passwd error messages

Source of passwd error messages I am testing if the passwd command could run if the setuid bit is disabled. I disabled the setuid by running the following command: chmod 0554 /bin/passwd After doing so, I tested if the passwd command would still be able to function. But as expected, it didn’t. Instead, it gave …

Total answers: 2

How to source some shell code not a file?

How to source some shell code not a file? There is a description of a source command: source is a bash shell built-in command that executes the content of the file passed as argument, in the current shell. It has a synonym in . (period). For example, for the sake of an experiment, I want …

Total answers: 2

Cannot source file using find, fzf, and xargs

Cannot source file using find, fzf, and xargs I am trying to use fzf to select and activate different virtual environments. However, I am receiving the follow error: xargs: source: No such file or directory My command comprises three parts: find | fzf | xargs (1) find locates my virtual environments, (2) a virtual environment …

Total answers: 1

how to find the list of binaries/packages a source provides

how to find the list of binaries/packages a source provides We can find the source of the package with apt show <package name>, but how do we find the list of all binaries or packages a source provides? For example apt show will give following information and more $ apt show linux-libc-dev Package: linux-libc-dev Version: …

Total answers: 1

OpenBSD: Where to seek for the source of programs in the base system?

OpenBSD: Where to seek for the source of programs in the base system? In OpenBSD, I use pkg_info -E $(which [cmd]) to be supplied with the name of the package/port to the executable/command [cmd]. Having this information I can further look for the source code to the software. However, there are some utilities that seem …

Total answers: 1

source bash string instead of file

source bash string instead of file I want to source a bash function from a string instead of a file at the command line, so instead of this: source file.sh I want to do something like: source `cat <<EOF some_func(){ echo “nodejs version: $(node –version)” echo “r2g version: $(r2g –version)” echo “npm version: $(npm –version)” …

Total answers: 1

Opposite of the `source` command

Opposite of the `source` command I use the source command in my bash script in order to read/print the variables values more linuxmachines_mount_point.txt export linuxmachine01=”sdb sdc sdf sdd sde sdg” export linuxmachine02=”sde sdd sdb sdf sdc” export linuxmachine03=”sdb sdd sdc sde sdf” export linuxmachine06=”sdb sde sdf sdd” source linuxmachines_mount_point.txt echo $linuxmachine01 sdb sdc sdf sdd …

Total answers: 7