how do I assign sed -E 's/."url":"([^"])./\1/' to b named variable in bash
how to do
b=" sed -E 's/.\"url":"([\^"\]*).*/\\1/' "
​
it is showing errors like
​
b="sed -E 's/.*"url":"([\^"\]*).*/\\1/'"
∙
∙
∙
∙
∙
​
​
these empty spaces
​
what should i do now
https://redd.it/17ztwr8
@r_bash
how to do
b=" sed -E 's/.\"url":"([\^"\]*).*/\\1/' "
​
it is showing errors like
​
b="sed -E 's/.*"url":"([\^"\]*).*/\\1/'"
∙
∙
∙
∙
∙
​
​
these empty spaces
​
what should i do now
https://redd.it/17ztwr8
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Removing noscript/header bar from terminal
I'm using i3 on both desktop and laptop, I searched for different solutions on removing a noscript/header bar (whichever you call it, the bar with the "File Edit View Search Terminal Help" buttons) some of them being, adding these lines to my i3 config:
default_border pixel 1 #or 0
default_floating_border pixel 1 #or 0
or just
new_window pixel1
With no avail. The border on my pc still persists and with them here, i3 doesn't notify of an error with the config file. On the other note, I remember adding a line to
I even tried straight up scp-ing the i3/config and picom.conf files from the other machine which didn't fix the issue.
​
https://redd.it/180bcqs
@r_bash
I'm using i3 on both desktop and laptop, I searched for different solutions on removing a noscript/header bar (whichever you call it, the bar with the "File Edit View Search Terminal Help" buttons) some of them being, adding these lines to my i3 config:
default_border pixel 1 #or 0
default_floating_border pixel 1 #or 0
or just
new_window pixel1
With no avail. The border on my pc still persists and with them here, i3 doesn't notify of an error with the config file. On the other note, I remember adding a line to
crontab -e on my laptop (and later removing it) which seems to have done the trick. I rambled through the browsing history but couldn't find the site from which I copied the line. I even tried straight up scp-ing the i3/config and picom.conf files from the other machine which didn't fix the issue.
​
https://redd.it/180bcqs
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Using sed to replace mismatched characters
I'm looking to contribute to an open source project, where I noticed that it prints commands like this:
I now want to use sed to replace the single quotes with matching ` in each bash noscript, but I can't get the right pattern.
The closest I got was being able to replace all single quotes with a `, but obviously I only want it where it's mismatched.
Is sed appropriate for this?
I'm ripping my hair out trying to learn the way to do it with the CLI instead of just writing a Python noscript.
Any pointers for how I could do this?
I'm on MacOS btw, so it's BSD sed. I've tried looking at the man pages and reading up online, but it's kinda confusing to me.
https://redd.it/180fncv
@r_bash
I'm looking to contribute to an open source project, where I noticed that it prints commands like this:
<command>'
Where inside the echoed string, a backtick is being matched with a single quote.
I checked the bash noscript, and this is how it's coded. First off - is this a mistake, or just a formatting error in my terminal?
So anyway, I used grep to find all instances of \ and luckily the codebase is not that big, so I could manually check which are being closed by a single quote.I now want to use sed to replace the single quotes with matching ` in each bash noscript, but I can't get the right pattern.
The closest I got was being able to replace all single quotes with a `, but obviously I only want it where it's mismatched.
Is sed appropriate for this?
I'm ripping my hair out trying to learn the way to do it with the CLI instead of just writing a Python noscript.
Any pointers for how I could do this?
I'm on MacOS btw, so it's BSD sed. I've tried looking at the man pages and reading up online, but it's kinda confusing to me.
https://redd.it/180fncv
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
confusing difference in behaviour between bash test and [ ]
Hi all,
it seems I found a difference in the behaviour of the bash builtin
$ touch foobar
$ if [ -e foo* ] ; then echo found ; fi
$ if [ -e "foo*" ] ; then echo found ; fi
$ if test -e foo ; then echo found ; fi
found
$ if test -e "foo" ; then echo found ; fi
$ type test
test is a shell builtin
$ type [
[[ is a shell keyword
$ bash --version
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Apparently `[[` doesn't expand wildcards. If I got the docs right it should behave like `test` with additional operators to combine expressions, so this surprised me.
Is this expected or a weird bug/edge case? I'm just trying to understand, the `test` solution if fine for my needs.
Thx
[https://redd.it/180lnb2
@r_bash
Hi all,
it seems I found a difference in the behaviour of the bash builtin
test and [[.$ touch foobar
$ if [ -e foo* ] ; then echo found ; fi
$ if [ -e "foo*" ] ; then echo found ; fi
$ if test -e foo ; then echo found ; fi
found
$ if test -e "foo" ; then echo found ; fi
$ type test
test is a shell builtin
$ type [
[[ is a shell keyword
$ bash --version
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Apparently `[[` doesn't expand wildcards. If I got the docs right it should behave like `test` with additional operators to combine expressions, so this surprised me.
Is this expected or a weird bug/edge case? I'm just trying to understand, the `test` solution if fine for my needs.
Thx
[https://redd.it/180lnb2
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Delve into the world of Bash
As an aspiring programmer, I'm eager to delve into the world of bash noscripting. Could you recommend a comprehensive resource that covers the full spectrum of bash noscripting concepts, from beginner to advanced level?
https://redd.it/180kybu
@r_bash
As an aspiring programmer, I'm eager to delve into the world of bash noscripting. Could you recommend a comprehensive resource that covers the full spectrum of bash noscripting concepts, from beginner to advanced level?
https://redd.it/180kybu
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Idk how to setup bash on windows
Actually i know how to setup bash on windows but it is not working as i expected. I am trying to make a scanner tool like the other tools on kali but im on windows so it is not working. Any ideas or solutions for that problem? Thanks.
https://redd.it/180nje0
@r_bash
Actually i know how to setup bash on windows but it is not working as i expected. I am trying to make a scanner tool like the other tools on kali but im on windows so it is not working. Any ideas or solutions for that problem? Thanks.
https://redd.it/180nje0
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Autocompletion for any shell and any command.
​
https://i.redd.it/hb4eu1qd3u1c1.gif
Features:
* Support multiple shells: bash/zsh/powershell/fish/nushell/elvish/xonsh
* Support multiple platforms: windows/macOS/linux
* Built-in completions for 1000+ commands ([full list](https://github.com/sigoden/argc-completions/blob/main/MANIFEST.md))
* Automatically generate completion noscript from help-text/man-page
* Lazy completing, lower memory consumption and faster startup time
source code: [https://github.com/sigoden/argc-completions](https://github.com/sigoden/argc-completions)
https://redd.it/1811o8n
@r_bash
​
https://i.redd.it/hb4eu1qd3u1c1.gif
Features:
* Support multiple shells: bash/zsh/powershell/fish/nushell/elvish/xonsh
* Support multiple platforms: windows/macOS/linux
* Built-in completions for 1000+ commands ([full list](https://github.com/sigoden/argc-completions/blob/main/MANIFEST.md))
* Automatically generate completion noscript from help-text/man-page
* Lazy completing, lower memory consumption and faster startup time
source code: [https://github.com/sigoden/argc-completions](https://github.com/sigoden/argc-completions)
https://redd.it/1811o8n
@r_bash
Get log entries after specific date and time
I'm currently getting the last 4 lines of the log with
----------------------------------------
Current date/time: 2023-11-22 17:39:52
Last boot date/time: 2023-11-22 17:27:43
----------------------------------------
2023-11-22T16:30:01+11:00 foo bar
2023-11-22T16:30:01+11:00 foo bar
2023-11-22T17:34:07+11:00 foo bar
2023-11-22T17:34:07+11:00 foo bar
What I want to do is only show log entries containing "foo" that have a date/time later the last boot date/time.
This is the actual code I'm currently using:
printf -- '-%.0s' {1..40} && echo
echo "Current date/time: $(date +"%Y-%m-%d %T")"
echo "Last boot date/time: $(uptime --since)"
booted="$(uptime --since | cut -d":" -f 1-2)"
printf -- '-%.0s' {1..40} && echo
grep nvme /var/log/synoscgi.log | tail -20
​
https://redd.it/1813f7c
@r_bash
I'm currently getting the last 4 lines of the log with
grep foo /var/log/foobar.log | tail -4----------------------------------------
Current date/time: 2023-11-22 17:39:52
Last boot date/time: 2023-11-22 17:27:43
----------------------------------------
2023-11-22T16:30:01+11:00 foo bar
2023-11-22T16:30:01+11:00 foo bar
2023-11-22T17:34:07+11:00 foo bar
2023-11-22T17:34:07+11:00 foo bar
What I want to do is only show log entries containing "foo" that have a date/time later the last boot date/time.
This is the actual code I'm currently using:
printf -- '-%.0s' {1..40} && echo
echo "Current date/time: $(date +"%Y-%m-%d %T")"
echo "Last boot date/time: $(uptime --since)"
booted="$(uptime --since | cut -d":" -f 1-2)"
printf -- '-%.0s' {1..40} && echo
grep nvme /var/log/synoscgi.log | tail -20
​
https://redd.it/1813f7c
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Oh-My-Zsh HYPHENINSENSITIVE option in Bash
Hi, I've searched both in this sub as well as on the interwebs but I was not able to find a solution.
As the noscript says, is there a way to have the HYPHENINSENSITIVE omz option in Bash?
What it does is that, if you have a file called
Thanks in advance!
https://redd.it/1817cgn
@r_bash
Hi, I've searched both in this sub as well as on the interwebs but I was not able to find a solution.
As the noscript says, is there a way to have the HYPHENINSENSITIVE omz option in Bash?
What it does is that, if you have a file called
some_file, you can type some- then hit TAB and it will be auto-completed to some_file, something I find to be very handy and also speeds up my work in the terminal.Thanks in advance!
https://redd.it/1817cgn
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Self-updating, Discord installer noscript, for Debian Based OS's
The flow of the noscript is shown below.
1. If an update is detected, update the master and download noscripts using sed.
2. If no update is detected, keep the master and download noscripts the same.
3. Once steps 1 or 2 are satisfied, run the download noscript to install the latest version of Discord.
4. Once step 3 is completed, delete the leftover download noscript.
5. Rinse and repeat as desired.
Again, the master noscript will also auto-update itself to the latest version.
Let me know what you guys think. It seems to run well but I love learning more efficient ways of doing things. So please, if you have some good advice do share!
GitHub - install-discord.sh
https://redd.it/18190ag
@r_bash
The flow of the noscript is shown below.
1. If an update is detected, update the master and download noscripts using sed.
2. If no update is detected, keep the master and download noscripts the same.
3. Once steps 1 or 2 are satisfied, run the download noscript to install the latest version of Discord.
4. Once step 3 is completed, delete the leftover download noscript.
5. Rinse and repeat as desired.
Again, the master noscript will also auto-update itself to the latest version.
Let me know what you guys think. It seems to run well but I love learning more efficient ways of doing things. So please, if you have some good advice do share!
GitHub - install-discord.sh
https://redd.it/18190ag
@r_bash
GitHub
noscript-repo/Bash/Installer Scripts/SlyFox1186 Scripts/install-discord.sh at main · slyfox1186/noscript-repo
Contribute to slyfox1186/noscript-repo development by creating an account on GitHub.
Bash noscript to connect external m.2 on pi 5
Hi,
I'm running emby media server (https://emby.media) in docker on a pi 5.
The pi5 OS is usb boot, the media is on two m.2 drives in caddies, one 1TB the other 2TB.
The issue is that (despite being in fstab), the 2TB btrfs drive needs manually unplugging / replugging to be mountable upon reboot.
Naturally, this sucks. So, I wrote a small bash noscript to emulate unplugging/replugging by turning the power off/on the USB port (the docker container is just named 'embyserver', the 2TB caddy is Ugreen).
The noscript seems to do what I want, but the drive isn't mountable - perhaps despite the reporting, uhubctl isn't really powering the port off/on due to incompatibility?
Any alternative ideas?
https://redd.it/181irjl
@r_bash
Hi,
I'm running emby media server (https://emby.media) in docker on a pi 5.
The pi5 OS is usb boot, the media is on two m.2 drives in caddies, one 1TB the other 2TB.
The issue is that (despite being in fstab), the 2TB btrfs drive needs manually unplugging / replugging to be mountable upon reboot.
Naturally, this sucks. So, I wrote a small bash noscript to emulate unplugging/replugging by turning the power off/on the USB port (the docker container is just named 'embyserver', the 2TB caddy is Ugreen).
#!/bin/bashpath=/mnt/2tbhub=$(uhubctl | grep -B1 Ugreen | head -1 | awk {'print $5'})port=$(uhubctl | grep Ugreen | awk {'print $2'}|cut -d ':' -f1) mounted=$(cat /proc/mounts | grep $path)if [[ -z "$mounted" ]]; then# how to select on vendor anyway?uhubctl -l $hub -p $port -a 0 sleep 2uhubctl -l $hub -p $port -a 1 sleep 5 mount /mnt/2tbsleep 2docker restart embyserverfiThe noscript seems to do what I want, but the drive isn't mountable - perhaps despite the reporting, uhubctl isn't really powering the port off/on due to incompatibility?
Any alternative ideas?
https://redd.it/181irjl
@r_bash
Emby
media server for personal streaming videos tv music photos in mobile app or browser for all devices android iOS windows phone appletv androidtv smarttv and dlna
How to use the getopts builtin with optional arguements.
Hi all, I'm working on a bash-only noscript (that you'll likely see posted here in a bit), and wanted to use
So (assuming the noscript is name getopts.sh), running
will return
EDIT: I threw in some comments giving a bit more of an explination.
https://redd.it/182e35x
@r_bash
Hi all, I'm working on a bash-only noscript (that you'll likely see posted here in a bit), and wanted to use
getopts with optional arguements. this question was asked on stack overflow, but the top answer seemed overly verbose/unclear, so I thought I'd share my solution. It meerly requires two tests at the start of processing, and then checking wether OPTARG is null or not for the respective arguement. The only 'gotcha' is that you can't use arguements that start with a dash.#! /bin/bash
while getopts ':abc:d:f' opt; do # use silent reporting with a ':' at the start of `optstring`
if [[ $opt == ':' ]]; then
# `opt` is set to ':' if an option is missing a specified argument
# and `OPTARG` is set to the option with a 'missing' argument
opt="$OPTARG"
unset OPTARG
elif [[ $OPTARG =~ ^- ]]; then
# unless the option with a potential argument comes last, this is needed to filter
# out any following options
((OPTIND--))
unset OPTARG
fi
#shellcheck disable=SC2220
case "$opt" in
a)
echo "opt: a"
;;
b)
echo "opt: b"
;;
c)
#echo "opt: c"
if [[ -z $OPTARG ]]; then
C="Hello there."
else
C="$OPTARG"
fi
;;
d)
#echo "opt: d"
if [[ -z $OPTARG ]]; then
D="efault."
else
D="$OPTARG"
fi
;;
f)
echo "opt: f"
;;
esac
done
echo "$C"
echo "$D"
So (assuming the noscript is name getopts.sh), running
$ ./getopt.sh -c -d "General Kanobi!"
will return
Hello there.
General Kanobi!
EDIT: I threw in some comments giving a bit more of an explination.
https://redd.it/182e35x
@r_bash
Stack Overflow
Optional option argument with getopts
while getopts "hd:R:" arg; do
case $arg in
h)
echo "usage"
;;
d)
dir=$OPTARG
;;
R)
if [[ $OPTARG =~ ^[0-9]+$ ]];then
level=$...
case $arg in
h)
echo "usage"
;;
d)
dir=$OPTARG
;;
R)
if [[ $OPTARG =~ ^[0-9]+$ ]];then
level=$...
Kill, an interactive bash-only noscript for killing processes/sending signals.
Small, interactive, bash-only noscript I made that (naturally) uses the 'kill' builtin. Apart from sending signals, it can also list the environment of a selected process sans 'LSCOLORS' (as the value of LSCOLORS is generally not helpful and is visually distracting). All you need to do is clone it and make it executable:) Link: https://github.com/unsigned-enby/Kill
https://redd.it/182hvgp
@r_bash
Small, interactive, bash-only noscript I made that (naturally) uses the 'kill' builtin. Apart from sending signals, it can also list the environment of a selected process sans 'LSCOLORS' (as the value of LSCOLORS is generally not helpful and is visually distracting). All you need to do is clone it and make it executable:) Link: https://github.com/unsigned-enby/Kill
https://redd.it/182hvgp
@r_bash
GitHub
GitHub - unsigned-enby/Kill: Small bash-only noscript for killing processes/sending signals
Small bash-only noscript for killing processes/sending signals - GitHub - unsigned-enby/Kill: Small bash-only noscript for killing processes/sending signals
How to process only a specific input file with AWK?
I am trying to write a AWK noscript for some data processing and I am passing 3 input files to it. I am trying to figure out how to process only the third input file at a certain point of the noscript so I can create an array called compare. I have a for loop that looks for protocols in a topprotos array , so there will be about 10 protocols in that array. Lets name them proto1 , proto2 , proto3 and so on...My 3rd input file has 4 fields in each line, first being a protocol and third being a value. fields 2 and 4 aren't relevant. But what I want to do is loop through the topprotos items and find lines in this file where the first field matches. So if we do "for protocol in topprotos" and protocol in this iteration is proto5 , I want to look for the lines in my 3rd input file that have the first field as "proto5" , now all these lines that match have the 3rd field value , I want to sum all these values together and then append it to compare. So for each iteration I will have something like compare[protocol\] += $3 , and if you do a print of something like "print protocol " " compare[protocol\]" in the loop after appending you should see all the iterations with there values like this.
proto1 200
proto2 400
proto3 100
proto4 500
proto5 230
​
and so on...
here is a pastebin to my code https://pastebin.com/THfm6qfj
if anyone could help me I would really appreciate it !!!
https://redd.it/182xeng
@r_bash
I am trying to write a AWK noscript for some data processing and I am passing 3 input files to it. I am trying to figure out how to process only the third input file at a certain point of the noscript so I can create an array called compare. I have a for loop that looks for protocols in a topprotos array , so there will be about 10 protocols in that array. Lets name them proto1 , proto2 , proto3 and so on...My 3rd input file has 4 fields in each line, first being a protocol and third being a value. fields 2 and 4 aren't relevant. But what I want to do is loop through the topprotos items and find lines in this file where the first field matches. So if we do "for protocol in topprotos" and protocol in this iteration is proto5 , I want to look for the lines in my 3rd input file that have the first field as "proto5" , now all these lines that match have the 3rd field value , I want to sum all these values together and then append it to compare. So for each iteration I will have something like compare[protocol\] += $3 , and if you do a print of something like "print protocol " " compare[protocol\]" in the loop after appending you should see all the iterations with there values like this.
proto1 200
proto2 400
proto3 100
proto4 500
proto5 230
​
and so on...
here is a pastebin to my code https://pastebin.com/THfm6qfj
if anyone could help me I would really appreciate it !!!
https://redd.it/182xeng
@r_bash
Pastebin
awk -F, -v hour="$4" -v tgtdate="$5" -v variance=50 ' (NF==2) { - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
emulating the full functionality of the history command with arrow key navigation within bash noscript
I am looking for a constant interactivity within a noscript allowing me as user to navigate and execute previous commands by using arrow keys. I have tried read and select but no way I get the history feature with arrow keys as we have in the bash shell. Any indea what command I can use? Thanks
https://redd.it/183a4qm
@r_bash
I am looking for a constant interactivity within a noscript allowing me as user to navigate and execute previous commands by using arrow keys. I have tried read and select but no way I get the history feature with arrow keys as we have in the bash shell. Any indea what command I can use? Thanks
https://redd.it/183a4qm
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Help choosing Bash alias and function names that WON'T come back to bite you later!
https://github.com/makesourcenotcode/name-safe-in-bash
https://redd.it/183blrk
@r_bash
https://github.com/makesourcenotcode/name-safe-in-bash
https://redd.it/183blrk
@r_bash
GitHub
GitHub - makesourcenotcode/name-safe-in-bash: Help choosing Bash alias and function names that WON'T come back to bite you later!
Help choosing Bash alias and function names that WON'T come back to bite you later! - GitHub - makesourcenotcode/name-safe-in-bash: Help choosing Bash alias and function names that WON&...
What Bash noscripts to know when working in a Cloud job?
Just passed my AWS Cloud Architect exam and now learning Bash. I am a complete beginner and have watched a few YouTube videos but can't seem to find any that focus on when working in the Cloud, just the basics.
If anyone has any examples of what would be expected to know when working with Cloud, I would be very grateful.
https://redd.it/183mhfb
@r_bash
Just passed my AWS Cloud Architect exam and now learning Bash. I am a complete beginner and have watched a few YouTube videos but can't seem to find any that focus on when working in the Cloud, just the basics.
If anyone has any examples of what would be expected to know when working with Cloud, I would be very grateful.
https://redd.it/183mhfb
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
Help with Bash noscript
Hi! I'm quite new to bash noscripting so this may seem like a bit of a newbie question but I'm having a bit of trouble with a noscript I just wrote, I've been playing around and tinkering around with it for a while but it still doesn't seem to do what I want it to, here's the noscript:
#!/bin/sh
url=$(firefox "$(cat ~/stor/bcomp/urls | dmenu)")
if -z $url
then
exit 0
else
firefox "$(cat ~/stor/bcomp/urls | dmenu)"
fi
exit
The main function of the noscript was to just act as a collection of bookmarks which is selected to be opened by firefox by piping the urls into dmenu. That works just fine. The only problem is that it creates a new Firefox instance when I exit dmenu. Is there any other way I could go about notifying the noscript if there's any input from the user from dmenu? I would really appreciate the help!
https://redd.it/183o9z1
@r_bash
Hi! I'm quite new to bash noscripting so this may seem like a bit of a newbie question but I'm having a bit of trouble with a noscript I just wrote, I've been playing around and tinkering around with it for a while but it still doesn't seem to do what I want it to, here's the noscript:
#!/bin/sh
url=$(firefox "$(cat ~/stor/bcomp/urls | dmenu)")
if -z $url
then
exit 0
else
firefox "$(cat ~/stor/bcomp/urls | dmenu)"
fi
exit
The main function of the noscript was to just act as a collection of bookmarks which is selected to be opened by firefox by piping the urls into dmenu. That works just fine. The only problem is that it creates a new Firefox instance when I exit dmenu. Is there any other way I could go about notifying the noscript if there's any input from the user from dmenu? I would really appreciate the help!
https://redd.it/183o9z1
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community
List to php array
Hi guys,
we have a shared nextcloud for the entire company, the users are syncing with the desktop client. Sometimes a ransomware infection happen and the sync client see: "oh! there's a change on this file. I need to sync this!" The last unencrypted files (in the cloud) get encrypted too. I could use the build-in feature 'blacklisted_files' with this list. The final array looks like this:
<?php
$CONFIG = array (
array (
0 => '.htaccess',
1 => 'Thumbs.db',
2 => 'thumbs.db',
),
);
Nextcloud can have multiple
​
https://redd.it/1843o1q
@r_bash
Hi guys,
we have a shared nextcloud for the entire company, the users are syncing with the desktop client. Sometimes a ransomware infection happen and the sync client see: "oh! there's a change on this file. I need to sync this!" The last unencrypted files (in the cloud) get encrypted too. I could use the build-in feature 'blacklisted_files' with this list. The final array looks like this:
<?php
$CONFIG = array (
array (
0 => '.htaccess',
1 => 'Thumbs.db',
2 => 'thumbs.db',
),
);
Nextcloud can have multiple
*.config.php files, they get merged, so I can provide an exclusive blacklist file. I want to get this extension list every day and put that into the array above. sed and awk are nice tools, but can they insert a enumeration too? ​
https://redd.it/1843o1q
@r_bash
Function that automatically resubmits last command with "--help" instead of "-h"
https://i.vgy.me/P8v1aY.png
https://redd.it/1849by3
@r_bash
https://i.vgy.me/P8v1aY.png
https://redd.it/1849by3
@r_bash
Bash Sugar ( a bash threads)
There used to be a bash thread, now there's not.
Lets change that.
Here's a thing for expanding aliases in zsh
https://redd.it/1858sjf
@r_bash
There used to be a bash thread, now there's not.
Lets change that.
Here's a thing for expanding aliases in zsh
#-------------------------------
# ealias
#-------------------------------
typeset -a ealiases
ealiases=()
function ealias()
{
alias $1
ealiases+=(${1%%\=*})
}
function expand-ealias()
{
if [[ $LBUFFER =~ "(^|[;|&])\s*(${(j:|:)ealiases})\$" ]]; then
zle _expand_alias
zle expand-word
fi
zle magic-space
}
zle -N expand-ealias
bindkey -M viins ' ' expand-ealias
bindkey -M viins '^ ' magic-space # control-space to bypass completion
bindkey -M isearch " " magic-space # normal space during searches
#-------------------------
ealias gc='git commit . -m '
ealias gp='git push'
https://redd.it/1858sjf
@r_bash
Reddit
From the bash community on Reddit
Explore this post and more from the bash community