Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:utility-scripts:chttl [2025/01/05 22:43] – Webmaster VitaNetworks | en:utility-scripts:chttl [2025/01/06 00:46] (current) – Webmaster VitaNetworks | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| '' | '' | ||
| - | |||
| - | <WRAP center round tip 80%> | ||
| - | ===== Make it a function ===== | ||
| - | This was originally written as a bash function. It was changed early on to '' | ||
| - | </ | ||
| ===== What does it do? ===== | ===== What does it do? ===== | ||
| Line 12: | Line 7: | ||
| ===== Wouldn' | ===== Wouldn' | ||
| - | Yes, but the command changes across operative systems. | + | Yes, but the command changes across operative systems. You'd need an alias for each, which is a bit more complicated to sync unless you add some logic to your aliases file, but wouldn' |
| ===== Is there something else? ===== | ===== Is there something else? ===== | ||
| - | - This is the first [intentionaly] POSIX-compliant script we've ever written. | + | - This is the first [intentionaly] POSIX-compliant script we've ever written.\\ |
| - | - It works on macOS, Linux and FreeBSD. | + | - It works on macOS, Linux and FreeBSD.\\ |
| - | - It can be used to set the value back to where it was as well, simply add it at the end. | + | - It can be used to set the value back to where it was as well, simply add it at the end.\\ |
| - | - It's not a permanent modification. | + | - It's not a permanent modification.\\ |
| - | Depending on the OS, you might need to create a file in a specific location or issue a special command that sets preference files. | + | |
| + | |||
| + | ==== Make it a function ==== | ||
| + | This was originally written as a bash function. It was changed early on to '' | ||
| + | |||
| + | === Using a functions file === | ||
| + | As a login shell, bash process config files in the following order: | ||
| + | - ''/ | ||
| + | - '' | ||
| + | - '' | ||
| + | - '' | ||
| + | Typically '' | ||
| + | '' | ||
| + | (meaning "//if '' | ||
| + | |||
| + | You may follow the bash's own example by invoking the functions file from '' | ||
| + | < | ||
| + | [Sun05@23: | ||
| + | total n | ||
| + | 24 -rw------- | ||
| + | 8 -rw-r-xr-x@ | ||
| + | ######################################################################################################## | ||
| + | #↑↑↑ Add 'if [ -f " | ||
| + | ######################################################################################################## | ||
| + | 8 -rw-r--r-- | ||
| + | 8 -rw-r-xr-x@ | ||
| + | 0 drwx------ | ||
| + | 16 -rw-r-xr-x@ | ||
| + | 0 drwxr-xr-x | ||
| + | [Sun05@23: | ||
| + | total n | ||
| + | 0 drwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 0 drwxr-xr-x | ||
| + | 0 drwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 16 -rwxr-xr-x@ | ||
| + | ######################################################################################################## | ||
| + | # | ||
| + | ######################################################################################################## | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 40 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x@ | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 64 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x@ | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 40 -rwxr-xr-x | ||
| + | 48 -rwxr-xr-x | ||
| + | 32 -rwxr-xr-x@ | ||
| + | 24 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 16 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 40 -rwxr-xr-x@ | ||
| + | 176 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | 8 -rwxr-xr-x | ||
| + | </ | ||
| ===== Syntax ===== | ===== Syntax ===== | ||
| The script takes one or no arguments; any additional argument(s) after the first one should be ignored. | The script takes one or no arguments; any additional argument(s) after the first one should be ignored. | ||
| Line 87: | Line 157: | ||
| This a task that requires superadmin privileges. The script does not attempt to elevate your permissions at any time; you will need to do that yourself by prepending '' | This a task that requires superadmin privileges. The script does not attempt to elevate your permissions at any time; you will need to do that yourself by prepending '' | ||
| + | ===== Anti-corporate takeover measure (licensing) ===== | ||
| + | chttl — Temporarily override the system' | ||
| + | Copyright (C) 2025 Gustavo Domínguez | ||
| + | |||
| + | This program is free software: you can redistribute it and/or modify | ||
| + | it under the terms of the GNU General Public License as published by | ||
| + | the Free Software Foundation, either version 3 of the License, or | ||
| + | (at your option) any later version. | ||
| + | |||
| + | This program is distributed in the hope that it will be useful, | ||
| + | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| + | GNU General Public License for more details. | ||
| + | |||
| + | You should have received a copy of the GNU General Public License | ||
| + | along with this program. | ||