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t9Evu6GRVwK3L3HDUQq3HZosjytl8d37PsHXWxd1xHIAXWCcqqwLKJ1dZEngBkVDBz0H652jEBbSXS0JRqAwx+Bsgdet/YO/pkC/RyivOIXsI+tQULinI5inCwNJ8q/uewG61XMlbu9Gv3j7zGhhhH5js/Q2Zv4DlnmjlaFZhNbfhsxTnmbqYh3OhdRCPkloy23E/CaZpxZXAKCNfk2RdZuoA+VhnMwTXAWAtmto+8CIIld5CzJO5zxJ5uGaYbjvwkDUMCbLvrPlFmC8RZ5rsisezeIGmjRwoPvT30Xbl9s3WyuT52aV5+qS1Aoefj5PvzWg2+3p5/M0QgqkweMNZpSKc72czBTJ6fwOtPPz+f8LMAAA+DuW/W2pegAAAABJRU5ErkJggg==">MoviesJoy - Free movies streaming, watch movies online</A>


What in the actual fuck.

https://redd.it/1d0oc21
@r_bash
Need help to understand this tbh

hello, let me tell you:

I was doing a noscript in bash and the situation has arisen where a function prints both informational messages and values that I will later want to store inside variables when I call the function in other functions or anywhere else in the noscript, something like this would be to represent the idea:

#!/usr/bin/env bash

foo(){
local a=${1} b=${2}
local sum=$(( a + b ))

printf "\n+ Checking something...\n"
printf "%s\n" $sum
}

bar(){
local value="$(foo 2 3)"
printf "%s\n" $value
}

bar

More or less this would be the idea but applied to the function I am performing, then I do not know where I read, that what used to be done was to redirect the informative messages to fd 2 and the values that will be used later to fd 1, so that then when calling the function to capture the values, on the one hand the informative messages are printed on the screen and also the value or values are stored in the declared variable (and only the value, not the informative messages).

Basically what I want is to store in a variable the value returned by the function and at the same time print the informative messages on the screen, without storing this ones inside the previous variable.

The thing is that I asked the AI what I could do and it told me this:

exec 3>&1
value=$( foo "${2}" "${3}" 2>&1 >&3 3>&1 )
exec 3>&-

And the truth is that after asking him several questions about this code, tbh I have not understood anything and it is very difficult for me to understand what is the purpose of all this sequence of commands.

I understand that exec 3>&1 what it does is to make a duplicate of fd 1 in fd 3 to keep the original state of fd 1, but I don't understand why.

And then in the next line I get even more lost, because I know that 2>&1 redirects stderr to stdout, but I do not understand why then redirects >&3 fd 1 (which contains fd 1 and fd 2) to fd 3 and then do 3>&1, the truth is that I do not understand anything and I would like to get to understand it.

Thank you in advance to the one(s) who will help me to solve my doubt 😊

https://redd.it/1d18wo7
@r_bash
Bash Script for Building Various GNU Programs from Source

Hey guys,

I have a GitHub repo that is mostly centered around productivity related tasks so I decided that I would create a build noscript to install what I consider to be the more mainstream GNU packages that are used more often than some of the others.

# Denoscription

This noscript will prompt you to choose which programs to install (you can choose all) and then it will download, build, and compile each program from the latest source code (except for autoconf, which is set to version 2.71 due to errors I have gotten from the latest version 2.72) .

The noscript also will create soft links to the folder located in /usr/local for any files found in the programs install directory in the folders bin, include, and lib/pkgconfig

# Optimizations

The noscript uses the following CFLAGS/CXXFLAGS settings: -O3 -pipe -flto -march=native

-O3: Is a compiler optimization level flag that tells the compiler to perform aggressive optimizations when compiling the code.
-pipe: Is used to tell the compiler to use pipes rather than temporary files for communication between the different stages of compilation. When you compile a program, there are several stages involved, such as preprocessing, compiling, assembling, and linking. Normally, intermediate files are created and stored on disk during each stage, but using pipes instead of files can potentially improve the compilation speed, especially on systems with slow disk I/O.
-flto: Stands for "Link Time Optimization." It instructs the compiler to perform optimizations across different source files during the linking phase of compilation.
-march=native: Tells the compiler to generate code optimized for the CPU architecture on which the compilation is being performed.

# Removal

Each package that you choose to install will be located at the path /usr/local/PROGRAM-NAME-VERSION so if you ever want to quickly remove a package you can run the below commands and it should fix any issues immediately IF you do experience errors or other issues.

cd /usr/local/
sudo rm -fr PROGRAM-NAME-VERSION

# Important info for people new to this type of thing or Linux in general

When you install the latest version of ANY package there is a potential for incompatibility which another way to say this is that you can get errors when doing daily tasks. These can be as severe as what you would call "system breaking" so make sure that you understand this before using the noscript. I personally have installed all packages on both Debian 12 and Ubuntu 22.04 and SO FAR have not seen any issues but that is the extent of my knowledge. So please do your own homework and for anyone that does try this I wish that this is something you find useful.

You can download the noscript here on GitHub.

Here's to hoping this makes someone's life better in some way.

Cheers - J

https://redd.it/1d1dxog
@r_bash
bash noscript stops at evaluating modulo

A bash noscript with "set -e" stops unexpectedly. To debug, I use

bash -x foobar

the last thing displayed is:

&#x200B;

\++ wc -l

\+ NDISKNODES=1

\+ export NDISKNODES

\++ expr 69677 % 1

\+ NODEINDEX=0

&#x200B;

The corresponding part of the noscript is:

NDISKNODES=`cat $DISKNODELIST | wc -l`

export NDISKNODES

NODEINDEX=`expr $PID % $NDISKNODES`

&#x200B;

So it doesn't seem to like the expr calculating a modulo?

$PID is the process ID, which is 69677 in example.

Same thing happens in Centos or Debian.

https://redd.it/1d1jjeu
@r_bash
What is a clever way to run your cronjobs?

I've created a node.js noscript that scrapes websites. I want them to give me a notification every 7 days. Mail or anything. What's the clever way to run this cronjob?

I don't have a mail smtp server..I am unable to think of a clever approach of notifying myself about the result of the noscript.

https://redd.it/1d1tz8u
@r_bash
Help with bash noscript

Can someone help to figure out where is mistake, I want to run noscript only if swap is over 60% but from log I see what swap is cleared every night

>!/bin/bash

>Get total Swap usage

>TOTAL_SWAP=$(swapon -s | awk '{print $3}' | grep -v 'Size')

>Convert Total Swap usage from KB to MB

>TOTAL_MB=$((TOTAL_SWAP/1024))

>Get 60% of total swap usage

>THRESHOLD=$(bc<<<$TOTAL_MB*0.6)

>Get currently used swap

>USED_SWAP=$(free -m | awk '/Swap/{print $3}')

>Check if currently used swap is greater than 60% of used swap

>if [ $USED_SWAP -gt ${THRESHOLD%.*} \]

>then

>BEFORE_CLEAR=$(date)

>echo "Cleaning swap started on $BEFORE_CLEAR" >> /tmp/swap.log

>/sbin/swapoff -a && /sbin/swapon -a

>AFTER_CLEAR=$(date)

>echo "Swap cleared on $AFTER_CLEAR" >> /tmp/swap.log

>fi

crontab -l

0 5 * * * /bin/bash /root/swap_clean

https://redd.it/1d2kdpj
@r_bash
Script to monitor live file changes in a directory in color

This noscript uses the ifnotifywait command to monitor multiple types of file events including:

create
delete
modify
move

The output in the terminal is colorized to reflect the type of file event and each entry is timestamped with the month-date-year hour:minute:second-AM/PM.

To use the noscript execute the below commands:

chmod +x monitor.sh
./monitor.sh --directory "/path/to/folder"

You can download the noscript here on GitHub.

Have a good day everyone.

https://redd.it/1d2q28b
@r_bash
If one number is larger than the other, then... Shellcheck gives me an error that isn't there

In my noscript, I have a directory that if sizes are bigger than 2 MB must show me a message.

My function (the one that works for me):

APPSIZE=$(du -s -- $APPSPATH/$arg | cut -f1 -d" ")
SCRIPTSIZELIMIT="2048"
if [ "$APPSIZE" < "$SCRIPTSIZELIMIT" ]; then

the error that Shellcheck reports:

< is for string comparisons. Use -lt instead.

but if I try using -lt, or -gt or (( )) instead of [[ \]\] or any other solution around the forums... I get error messages.

I don't understand. "Comparison" is what I need, and "-lt" does not work for me.

https://redd.it/1d2pkg6
@r_bash
Build the latest GCC versions 10-14 on Debian-based OS

You can build the latest versions of GCC 10,11,12,13,14. The noscript finds the correct download links automatically.

The noscript also installs an autoconf version 2.69 in the GCC build directory which is required to install GCC so it's even easier to use. This is done so it does not overwrite your APT package manager or any manual installs that you have.

I would have made this universal but I don't have fast access to REHL and Arch lacks for nothing so I targeted what I use which is Debian-based OS.

Just run the noscript and enter a few choices and you're off.

You can find this here on GitHub.

# Installation Info

This will install the specific GCC version in this folder /usr/local/gcc-VERSION so if you ever want to delete it delete the corresponding folder.

# Disclaimer

The SUDO command is INSIDE the noscript where it is required. Feel free to notice the commands that use them for anyone who is cautious (I understand). It is not a good practice to run all commands as root and it can even mess up the noscript sometimes depending on what is written in it. So I had to go this route.

# Execution

chmod +x build-gcc.sh
./build-gcc.sh

# Optional Settings

I prefer to run my noscript using verbose mode. You can turn this on by changing verbose=0 to verbose=1 otherwise there is virtually no output during the build.

Have a great day everyone.

https://redd.it/1d3zeaf
@r_bash
Help with converting Windows BAT file to bash noscript.

Hi all,

I'm running Linux Mint Mate 21.3 Virginia and I'm trying to convert a series of Windows BAT files that are for an old FPGA programmer I have. The IDE portion of the software runs in Linux but the uploader to the board is a series of BAT noscripts. I'm trying to convert them to .sh files, but I'm having really basic errors.

Firstly, the first line of my .sh file is:

#! /usr/bin/bash

However, when I execute the file I get the following error:

bash: ./program.sh: /usr/bin/bash^M: bad interpreter: No such file or directory

I'm guessing that I have something setup incorrectly in xed so that it's appending the \^M character to the carriage return, but I'm not sure how to fix it. The bash location is correct.

$ which bash
/usr/bin/bash

Any help appreciated.

https://redd.it/1d43lp8
@r_bash
What key is M in yhis shortcut? forward-word (M-f) ¶

Hi, I'd like to know what is the key M in M-f
Thank you!

https://redd.it/1d4gcye
@r_bash
Oh-My-bash colours problem

Hello everyone 👋
Some time ago I decided to jump on bash terminal. Mostly I use it as is with default settings but now I find Oh-my-bash extension what sounds great because of customisation possibilities.

Now, I have installed Oh-My-Bash and there is few problems with it.
First one is with directory colours. When I set some theme in .bashrc file and restart it source .bashrc, theme have effect on „main” info in console like on date, time, or current location. But for example when I’m in home (or whatever) and do ls/ll the directories funded by this command have white colour, the same as .txt file, or even executable .sh files. How I can resolve this problem?

Second one is with theme colour itself. Most of my app have set specific colour palette and in this case also I would like to use the same colour palette.
I know that oh-my-bash have GitHub page and pretty well done documentation but they do not explain this topic very well. So there is my second question, how I can customise one of themes and change colours in this?
P.S
When I copy one of themes to .oh-my-bash/custom/themes and then set this as variable in .bashrc the theme has no effect. It’s looks like bash don’t even look in custom directory.

Thanks for every response 👍🏻

https://redd.it/1d4nemp
@r_bash
Impossible bash prompt?

I'm in the process of customizing my bash prompt. I added an approx. measure of elapsed time (see the picture). However, I'd love to hide this when there is no stdout (see the red arrow). However, the longer I try the more I feel this is impossible. Does someone has an idea how I could manage to get this working?

https://preview.redd.it/yuu2lep4sq3d1.png?width=540&format=png&auto=webp&s=489dd94971b62e5e07c9a1d122446006b95efcbc



https://redd.it/1d4sp77
@r_bash
Generate random ipv6 unique local address

I use the following website for generating ipv6 local addresses: https://unique-local-ipv6.com/

I would love to use a posix shell noscript instead though. Are there any pre-existing tools or methods to do this?

Thank you

https://redd.it/1d50zkh
@r_bash
Many open issues for ble.sh (bash line editor)

I see a lot of open issues in ble.sh:

https://github.com/akinomyoga/ble.sh/issues

Up to now I have not used the bash line editor.

But it looks good.

Do you recommend ble.sh or do you suggest using an alternative?

Update: Looking at the Contributor page of ble.sh at Github makes me sad. There is only one person working on that project. I guess it is time to realize that for interactive usage a different tool might be better. Follow-up: From Bash to Fish?

https://redd.it/1d52uu3
@r_bash
From Bash to Fish?

I use the Bash for more than 20 years.

I like the Bash shell. I write noscripts with:

trap 'echo "ERROR: A command has failed. Exiting the noscript. Line was ($0:$LINENO): $(sed -n "${LINENO}p" "$0")"; exit 3' ERR
set -Eeuo pipefail


And this helps me to automate many things.

But looking at ble.sh (previous reddit post about ble.sh) somehow makes me cry. It looks good, but there is only one maintainer.

While Bash is great for noscripting, it seems to be outdated for interactive usage.

I looked at Fish, and I like it.

How do you feel about that? Do you use Fish? Do you use it for noscripting, too?

https://redd.it/1d53k9o
@r_bash
Time

Hello, i need help when it comes to create noscript that comparise changes between actual time and last time when i runned the noscript. How can i edit prevtime variable to make this works?

curtime=$(date "+%Y-%m-%d %H:%M:%S")
prevtime=$(cat last_run_time.txt)
echo $curtime > last_run_time.txt
echo $prevtime > last_run_time_previous.txt

https://redd.it/1d5a7or
@r_bash
A bash random word generator with huge english dictionaries

I mostly just think of this as a toy for entertainment, I have used it some over the past couple of years. However, it does have its creative and practical uses. It was just a reaction to the fact that online, I have seen random word generators, and they didn't show me any words I was unfamiliar with.

Link to repository:

https://github.com/LEDparty/bash-rwg/tree/main

https://redd.it/1d5awsb
@r_bash
Trouble passing names of files to pdftk

Hi guys I'm trying to merge some pdf files into one with pdftk. So I'm doing a basic grep and formating the output but pdftk keeps trying to open a a file that does not exists.
the noscript is

pdftk $(ls | grep ".pdf$" | sed 's/ /\\ /g' | tr '\n' ' ') cat output test_new.pdf

if I have a file like 'My file' pdftk will try to open My\\ but obviusly it does not exists... So any Idea of why that happens???

https://redd.it/1d5on70
@r_bash