I see that as well.
have a screenshot with the popup in it and the relevant parts marked in red by yours truly:

I see that as well.
The tee command might be unfamiliar to some but tee which comes in very handy at times, especially when you have a live system and want to capture outputs (e.g. from /var/log/messages ) even when the system would crash unexpectedly meaning any shutdown / reboot saving-current-settings into a module would fail even when the saving-current-settings script would incorporate saving of /var/log/messages.In computing, tee is a command in command-line interpreters (shells) using standard streams which reads standard input and writes it to both standard output and one or more files, effectively duplicating its input. It is primarily used in conjunction with pipes and filters. The command is named after the T-splitter used in plumbing.
Code: Select all
tail -fn 10 /var/log/messages|tee -a $myfile
Code: Select all
sensors|grep Core
Code: Select all
guest@rava:/usr/local/bin$ cat /usr/local/bin/mysensors.sh
#!/bin/sh
#V0.2
function tz () {
echo $(date +%d.%m.%Y\ %H:%M:%S) ____________________________________________________________
}
tz
sensors|grep Core
guest@rava:/usr/local/bin$ mysensors.sh
13.09.2023 06:36:51 ____________________________________________________________
Core 0: +63.0°C (high = +84.0°C, crit = +100.0°C)
Core 1: +62.0°C (high = +84.0°C, crit = +100.0°C)
Core 2: +63.0°C (high = +84.0°C, crit = +100.0°C)
Core 3: +62.0°C (high = +84.0°C, crit = +100.0°C)
Aside from what I wrote above already, I realized having two sound files chose from (my usual lowered in volume by -15 dB an the non-volume-changed original) can be useful at times, especially when I plan on watching some video (or maybe listening to audio) during the wait time and I want he dauerlalarm sound to be more loud and more annoying )
Code: Select all
notify-send -i info -t 0 "Encoding" "finished"
Thanks beny.Rava wrote: ↑18 Sep 2023, 11:48[Porteus supports the "3" kernel cheat code, add it to our kernel append parameter and you boot into init 3 (Slackware standard, Virtual Text terminals, multiuser, network)]
I prefer it that way as well, it takes a mere seconds to manually log in as guest and then typebut gives you much more control, also you can scroll up in the 1st terminal and review all boot messages even when they are already scrolled outside of the visible screen, something you cannot do when you boot into your XWindows and your chosen DE.Code: Select all
startx
Added in 3 minutes 59 seconds:
Cave! The scrolling up only works when you did not change to a different virtual terminal ("VT"). When you stay in one virtual terminal you can scroll up to see much more output of current program or from boot, but when you change the VT you can only access what is currently seen, all that is scrolled up is gone.
for those who do not know, scrolling up or scrolling down in a VT is done viaorCode: Select all
Shift + PageUp
Code: Select all
Shift + PageDown
Rava wrote: ↑18 Sep 2023, 14:09⬤ When using mc you can either navigate through the folders like usual (double-click or press return on a folder, move up by doing that on the ".." entry)
⬤ or just type in the command prompt below the command⬤ or start mc with the two folders you want to copy files in between.Code: Select all
cd /tmp
Let's assume your module is in /tmp/ and you have a symlink that links to your main Porteus modules folder called /Porteus_modules
then just typeUsually it would be enough to typeCode: Select all
mc /tmp/ /Porteus_modules
since by default there exists no folder or file in / that starts with a upper-case P like your link /Porteus_modules does.Code: Select all
mc /tmp/ /P[tab]
The [tab] then expands it to the only existing name -> /Porteus_modules
Yes, in some many cases using the terminal (and that includes mc) can let you do things quicker than a GUI equivalent especially when you use symlinks named in an easily remembered and unique way (as in: the first character of your symlink doesn't exist in that very folder aside from your symlink)
Code: Select all
#!/bin/sh
#based on mysensors.sh V0.2 and tail+tee_VLM.sh V0.2
function tz () {
echo $(date +%d.%m.%Y\ %H:%M:%S) ____________________________________________________________
}
if [ $UID -ne 0 ]; then
echo "$0: ERROR - start me as user root. Aborting."
exit 1
fi
mydate=$(date +%Y-%m-%d)
echo mydate suffix I am using: $mydate
myfile=sensors_$mydate
echo myfile I am using: $myfile - WILL OVERWRITE EXISTING ENTRIES
echo $(date +%d.%m.%Y\ %H:%M:sensors_%S) started: $0 >$myfile
while true; do { tz|tee -a $myfile; sensors|grep Core|tee -a $myfile ; sleep 1m ; } done
Code: Select all
guest@rava:/mnt/sda3/log$ ls -o sensors_2023-09-20
-rw-r--r-- 1 root 18618 2023-09-20 02:20 sensors_2023-09-20
Code: Select all
root@rava:/mnt/sda3/log# ./mysensorslog.sh
mydate suffix I am using: 2023-09-20
myfile I am using: sensors_2023-09-20 - WILL OVERWRITE EXISTING ENTRIES
20.09.2023 01:20:56 ____________________________________________________________
Core 0: +56.0°C (high = +84.0°C, crit = +100.0°C)
Core 1: +55.0°C (high = +84.0°C, crit = +100.0°C)
Core 2: +57.0°C (high = +84.0°C, crit = +100.0°C)
Core 3: +55.0°C (high = +84.0°C, crit = +100.0°C)
Code: Select all
20.09.2023 01:20:56 ____________________________________________________________
Core 0: +56.0°C (high = +84.0°C, crit = +100.0°C)
Core 1: +55.0°C (high = +84.0°C, crit = +100.0°C)
Core 2: +57.0°C (high = +84.0°C, crit = +100.0°C)
Core 3: +55.0°C (high = +84.0°C, crit = +100.0°C)
20.09.2023 01:21:56 ____________________________________________________________
Core 0: +55.0°C (high = +84.0°C, crit = +100.0°C)
Core 1: +52.0°C (high = +84.0°C, crit = +100.0°C)
Core 2: +56.0°C (high = +84.0°C, crit = +100.0°C)
Core 3: +52.0°C (high = +84.0°C, crit = +100.0°C)
20.09.2023 01:22:56 ____________________________________________________________
Core 0: +55.0°C (high = +84.0°C, crit = +100.0°C)
Core 1: +52.0°C (high = +84.0°C, crit = +100.0°C)
Core 2: +55.0°C (high = +84.0°C, crit = +100.0°C)
Core 3: +52.0°C (high = +84.0°C, crit = +100.0°C)
Code: Select all
tz|tee -a $myfile;
Code: Select all
echo -n >/mnt/sda3/log/sensors_2023-09-20
Code: Select all
tail -f /mnt/sda3/log/sensors_2023-09-20
Code: Select all
tail: /mnt/sda3/log/sensors_2023-09-20: file truncated
Code: Select all
root@rava:~# cd /mnt/sda3/log/
root@rava:/mnt/sda3/log/# ./mysensorslog.sh
Code: Select all
startx
Code: Select all
tail -f /mnt/sda3/log/sensors_2023-09-20
Code: Select all
for d in */ ; do printf 'make-ffplay-script %q\n' "${d%/}"; done > myfindloop_pjh.sh
chmod -v a+x myfindloop_pjh.sh
Code: Select all
for d in */ ; do echo make-ffplay-script \""$d"\"; done > myfindloop.sh
chmod -v a+x myfindloop.sh
Other essential reads:How can I find and safely handle file names containing newlines, spaces or both?
First and foremost, to understand why you're having trouble, read Arguments to get a grasp on how the shell understands the statements you give it. It is vital that you grasp this matter well if you're going to be doing anything with the shell.
The preferred method to deal with arbitrary filenames is still to use find(1):
or, if you need to handle filenames en masse:Code: Select all
find ... -exec command {} \;
xargs is rarely ever more useful than the above, but if you really insist, remember to use -0 (-0 is not in the POSIX standard, but is implemented by GNU and BSD systems):Code: Select all
find ... -exec command {} +
Use one of these unless you really can't.Code: Select all
# Requires GNU/BSD find and xargs find ... -print0 | xargs -r0 command # Never use xargs without -0 or similar extensions!
Another way to deal with files with spaces in their names is to use the shell's filename expansion (globbing). This has the disadvantage of not working recursively (except with zsh's extensions or bash 4's globstar), and it normally does not include hidden files (filenames beginning with "."). But if you just need to process all the files in a single directory, and omitting hidden files is okay, it works fantastically well.
For example, this code renames all the *.mp3 files in the current directory to use underscores in their names instead of spaces (this uses the bash/ksh extension allowing "/" in parameter expansion):
You can omit the "if..." and "fi" lines if you're certain that at least one path will match the glob. The problem is that if the glob doesn't match, instead of looping 0 times (as you might expect), the loop will execute once with the unexpanded pattern (which is usually not what you want). You can also use the bash extension "shopt -s nullglob" to make empty globs expand to nothing, and then again you can omit the if and fi.Code: Select all
# Bash/ksh for file in ./*\ *.mp3; do if [ -e "$file" ] ; then # Make sure it isn't an empty match mv "$file" "${file// /_}" fi done
For more examples of renaming files, see FAQ #30.
Remember, you need to quote all your Parameter Expansions using double quotes. If you don't, the expansion will undergo WordSplitting (see also argument splitting and BashPitfalls). Also, always prefix globs with "/" or "./"; otherwise, if there's a file with "-" as the first character, the expansions might be misinterpreted as options.
Another way to handle filenames recursively involves using the -print0 option of find (a GNU/BSD extension), together with bash's -d extended option for read:
The preceding example reads all the files under /tmp (recursively) into an array, even if they have newlines or other whitespace in their names, by forcing read to use the NUL byte (\0) as its line delimiter. Since NUL is not a valid byte in Unix filenames, this is the safest approach besides using find -exec. IFS= is required to avoid trimming leading/trailing whitespace, and -r is needed to avoid backslash processing. In fact, $'\0' is actually the empty string (bash doesn't support passing NUL bytes to commands even built-in ones) so we could also write it like this:Code: Select all
# Bash unset a i while IFS= read -r -d $'\0' file; do a[i++]="$file" # or however you want to process each file done < <(find /tmp -type f -print0)
So, why doesn't this work?Code: Select all
# Bash unset a i while IFS= read -r -d '' file; do a[i++]="$file" done < <(find /tmp -type f -print0)
Because of the pipeline, the entire while loop is executed in a SubShell and therefore the array assignments will be lost after the loop terminates. (For more details about this, see FAQ #24.)Code: Select all
# DOES NOT WORK unset a i find /tmp -type f -print0 | while IFS= read -r -d '' file; do a[i++]="$file" done
For a longer discussion about handling filenames in shell, see Filenames and Pathnames in Shell: How to do it Correctly.
CategoryShell