behaviour of GLOBIGNORE changed?
So far I have used GLOBIGNORE to prevent
For a few days now I notice that ssh-add complains about permissions
I changed the command to
I also tried the more generic
FWIW: our systems were upgraded from RHEL 7 to 8 recently, is there a connection?
https://redd.it/12p7218
@r_bash
So far I have used GLOBIGNORE to prevent
ssh-add from trying to load my public keys. My .bashrc contains (contained ...)GLOBIGNORE="*.pub"
ssh-add ~/.ssh/id*
For a few days now I notice that ssh-add complains about permissions
0644 for my *.pub files so obviously it's trying to load them.I changed the command to
GLOBIGNORE="/home/*/.ssh/*.pub" and this helps, but I'm wondering if, when and why this changed, or am I totally on the wrong track?I also tried the more generic
/*/.ssh/*.pub (which would also work for /root) and this does not match for user home directories (only /root).FWIW: our systems were upgraded from RHEL 7 to 8 recently, is there a connection?
https://redd.it/12p7218
@r_bash
Reddit
r/bash on Reddit: behaviour of GLOBIGNORE changed?
Posted by u/thseeling - No votes and no comments
A new paradigm file-manager
By accident I might stumble upon a new way of doing command line – in the project: [https://github.com/psprint/n-commodore](https://github.com/psprint/n-commodore). it is written in Zsh but can be run from any shell.
Basically it’s about 3 factors:
* panelize everything,
* grep everything,
* save everything.
Panelization is known from Midnight Commander - it means to capture command output into a list that can be browsed. Grepping is known from fzf. Screen saving is a new paradigm
In short, you have a new screen (a greppable panel) for each new command, which is saved to the disk (GDBM), and which can be fetched/navigated to, having also PWD dir and position in panel restored.
Asciicasts:
[https://asciinema.org/a/578076](https://asciinema.org/a/578076)
[https://asciinema.org/a/578088](https://asciinema.org/a/578088) (new features: 2 column view, man page viewing and ag/ripgrep/ack interface).
​
https://preview.redd.it/71toi7je0mua1.png?width=767&format=png&auto=webp&v=enabled&s=e0f08dcb1fa9245a5b4d38e4061fb21ab4f83490
https://redd.it/12qh07j
@r_bash
By accident I might stumble upon a new way of doing command line – in the project: [https://github.com/psprint/n-commodore](https://github.com/psprint/n-commodore). it is written in Zsh but can be run from any shell.
Basically it’s about 3 factors:
* panelize everything,
* grep everything,
* save everything.
Panelization is known from Midnight Commander - it means to capture command output into a list that can be browsed. Grepping is known from fzf. Screen saving is a new paradigm
In short, you have a new screen (a greppable panel) for each new command, which is saved to the disk (GDBM), and which can be fetched/navigated to, having also PWD dir and position in panel restored.
Asciicasts:
[https://asciinema.org/a/578076](https://asciinema.org/a/578076)
[https://asciinema.org/a/578088](https://asciinema.org/a/578088) (new features: 2 column view, man page viewing and ag/ripgrep/ack interface).
​
https://preview.redd.it/71toi7je0mua1.png?width=767&format=png&auto=webp&v=enabled&s=e0f08dcb1fa9245a5b4d38e4061fb21ab4f83490
https://redd.it/12qh07j
@r_bash
GitHub
GitHub - psprint/n-commodore: A next-generation file manager
A next-generation file manager. Contribute to psprint/n-commodore development by creating an account on GitHub.
Interesting grep behaviour after power outage
Flagged as help but just to draw an expert opinion if you care to comment. I am can sort this out with another pass of grep.
I have many folders called say “monthA, monthB, monthC… monthZ”
Each contains numerous text files either do or do not contain the pairs of letters AA, BB,CC. I only want to keep the ones that do have them.
I started a bit of grep and pipe with this:
It takes an hour to do each monthX file. We had a power cut. It stopped grepoing halfway through say monthD.
Power came back on. When I booted up and started the grep and pipe again it left monthD partially deleted and started on monthD.
I guess there’s a flag or algo decision somewhere and that is expected. I would have expected it to either start again at monthA or halfway through monthD. Anyone shed any light? I suppose it marks monthD as done when it closes it abruptly or something.
https://redd.it/12r1uj4
@r_bash
Flagged as help but just to draw an expert opinion if you care to comment. I am can sort this out with another pass of grep.
I have many folders called say “monthA, monthB, monthC… monthZ”
Each contains numerous text files either do or do not contain the pairs of letters AA, BB,CC. I only want to keep the ones that do have them.
I started a bit of grep and pipe with this:
-v -E -l -r ‘ AA| BB| CC’ month*/ | while read line; do ram “$line”; done;
It takes an hour to do each monthX file. We had a power cut. It stopped grepoing halfway through say monthD.
Power came back on. When I booted up and started the grep and pipe again it left monthD partially deleted and started on monthD.
I guess there’s a flag or algo decision somewhere and that is expected. I would have expected it to either start again at monthA or halfway through monthD. Anyone shed any light? I suppose it marks monthD as done when it closes it abruptly or something.
https://redd.it/12r1uj4
@r_bash
Reddit
r/bash on Reddit: Interesting grep behaviour after power outage
Posted by u/keithreid-sfw - No votes and no comments
Is it okay to include bash noscripting in an embedded systems end of studies project?
I would love to see if there is anyone here who included it in his/her end of studies project. I tried to only use python with Raspberry Pi, since it seems more known in my university, but I keep having problems with the Speech Recognition module.
Now I'm considering using a bash noscript (and a microphone) to record audio and turn it into text, and using python within the noscript to read (via speakers) the final output based on the text.
TLDR: Do you think the professors within the jury will approve of using bash in an embedded systems end of studies project?
https://redd.it/12rskkq
@r_bash
I would love to see if there is anyone here who included it in his/her end of studies project. I tried to only use python with Raspberry Pi, since it seems more known in my university, but I keep having problems with the Speech Recognition module.
Now I'm considering using a bash noscript (and a microphone) to record audio and turn it into text, and using python within the noscript to read (via speakers) the final output based on the text.
TLDR: Do you think the professors within the jury will approve of using bash in an embedded systems end of studies project?
https://redd.it/12rskkq
@r_bash
Reddit
r/bash on Reddit: Is it okay to include bash noscripting in an embedded systems end of studies project?
Posted by u/Sylerb - No votes and no comments
Split full path and filename into path and filename.
I am currently doing this using a for loop. There must be an easier way.
fullpathfile="/path/to/where/file/is/stored.txt"
I want path="/path/to/where/file/is/" and file="stored.txt"
https://redd.it/12rt67y
@r_bash
I am currently doing this using a for loop. There must be an easier way.
fullpathfile="/path/to/where/file/is/stored.txt"
I want path="/path/to/where/file/is/" and file="stored.txt"
https://redd.it/12rt67y
@r_bash
Reddit
r/bash on Reddit: Split full path and filename into path and filename.
Posted by u/thisiszeev - No votes and 6 comments
Why is it that a command run from the terminal command line produces line break but the same command run within bash noscript has no line break/
If I run the following commands
I see output with line breaks in the output like
​
But if I put assign the output of that command to a noscript variable and then echo that variable
My output has no line breaks
So why do I get line breaks with the first approach but not the second? Is the difference explained by different behaviors between cat vs. echo?
Thanks very much.
https://redd.it/12rzx3b
@r_bash
If I run the following commands
lsblk > junk2.txtcat junk2.txtI see output with line breaks in the output like
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTSloop0 7:0 0 285M 1 loop /snap/atom/282loop1 7:1 0 284.9M 1 loop /snap/atom/286loop2 7:2 0 4K 1 loop /snap/bare/5​
But if I put assign the output of that command to a noscript variable and then echo that variable
temp1=$(lsblk) echo $temp1 My output has no line breaks
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS loop0 7:0 0 285M 1 loop /snap/atom/282 loop1 7:1 0 284.9M 1 loop /snap/atom/286 loop2 7:2 0 4K 1 loop /snap/bare/5 So why do I get line breaks with the first approach but not the second? Is the difference explained by different behaviors between cat vs. echo?
Thanks very much.
https://redd.it/12rzx3b
@r_bash
Reddit
r/bash on Reddit: Why is it that a command run from the terminal command line produces line break but the same command run within…
Posted by u/ShaneFerguson - No votes and 2 comments
Storing a directory path as a variable, then passing it on to the 'ln -s' (symbolic link) command?
I stored directory in a variable:
I confirmed the directory was stored with the echo command:
The directory is displayed with the quotation marks as desired.
I then tried to pass it on to ln -s:
I get the error message:
https://redd.it/12s6aze
@r_bash
I stored directory in a variable:
var=$"'/media/disk2/video/001.mp4'" I confirmed the directory was stored with the echo command:
echo $var The directory is displayed with the quotation marks as desired.
I then tried to pass it on to ln -s:
ln -s $var 001_link.mp4I get the error message:
ln: target '001_link.mp4': No such file or directoryhttps://redd.it/12s6aze
@r_bash
Reddit
r/bash on Reddit: Storing a directory path as a variable, then passing it on to the 'ln -s' (symbolic link) command?
Posted by u/Long_Bed_4568 - No votes and no comments
Intro to Bash noscripting for scraping and automation
https://www.trickster.dev/post/intro-to-bash-noscripting-for-scraping-and-automation/
https://redd.it/12sutav
@r_bash
https://www.trickster.dev/post/intro-to-bash-noscripting-for-scraping-and-automation/
https://redd.it/12sutav
@r_bash
www.trickster.dev
Intro to Bash noscripting for scraping and automation – Trickster Dev
Code level discussion of web scraping, gray hat automation, growth hacking and bounty hunting
DISCUSSION What if BASH could be used as a web server interpreter?
I've been BASHing for about 2 years now... it's changed my life.
The other day I was writing some code in PHP and it dawned on me, can I not find a way to run BASH as a web server interpreter?
Already I am managing SQL databases with BASH? I have used it to generate static HTML pages at regular time intervals. I have even used it to generate SVG and convert them into PDF files. It would be so nice to be able to make an index.sh rather than index.php... and I haven't yet found a problem I couldn't solve with BASH, except this?
Would like to get a discussion going and see what other people's views are, solely as a thought experiment. Would such an interpreter be practical and useful, or would it just be another dev tool in an ocean of dev tools?
No flaming please, I just want to have a righteous discussion/debate about if this sort of thing did exist now and how it would affect us as BASHers and/or the industry as a whole.
https://redd.it/12t6nnr
@r_bash
I've been BASHing for about 2 years now... it's changed my life.
The other day I was writing some code in PHP and it dawned on me, can I not find a way to run BASH as a web server interpreter?
Already I am managing SQL databases with BASH? I have used it to generate static HTML pages at regular time intervals. I have even used it to generate SVG and convert them into PDF files. It would be so nice to be able to make an index.sh rather than index.php... and I haven't yet found a problem I couldn't solve with BASH, except this?
Would like to get a discussion going and see what other people's views are, solely as a thought experiment. Would such an interpreter be practical and useful, or would it just be another dev tool in an ocean of dev tools?
No flaming please, I just want to have a righteous discussion/debate about if this sort of thing did exist now and how it would affect us as BASHers and/or the industry as a whole.
https://redd.it/12t6nnr
@r_bash
Aggregate multiple lines
I have a file that looks like this -
a 6509568
a 8011776
a 8011776
a 8011776
a 8011776
b 1112800
b 1369600
b 1369600
How do I make it look like -
a 38556672
b 3852000
https://redd.it/12t9df7
@r_bash
I have a file that looks like this -
a 6509568
a 8011776
a 8011776
a 8011776
a 8011776
b 1112800
b 1369600
b 1369600
How do I make it look like -
a 38556672
b 3852000
https://redd.it/12t9df7
@r_bash
Reddit
r/bash on Reddit: Aggregate multiple lines
Posted by u/daredevildas - No votes and 1 comment
kube-dialog update
Hi, I've just updated kube-dialog with a filter command, you can filter namespaces and objects(pods,jobs...) with ease now, enjoy)
https://preview.redd.it/d8zv5c0jp3va1.png?width=742&format=png&auto=webp&v=enabled&s=7da1fc340ca5be8cfd2bf0ac3a709b435c3b0bc9
https://redd.it/12teich
@r_bash
Hi, I've just updated kube-dialog with a filter command, you can filter namespaces and objects(pods,jobs...) with ease now, enjoy)
https://preview.redd.it/d8zv5c0jp3va1.png?width=742&format=png&auto=webp&v=enabled&s=7da1fc340ca5be8cfd2bf0ac3a709b435c3b0bc9
https://redd.it/12teich
@r_bash
GitHub
GitHub - vaniacer/kube-dialog: Dialog wrapper for kubectl on bash.
Dialog wrapper for kubectl on bash. Contribute to vaniacer/kube-dialog development by creating an account on GitHub.
Pure bash password generator
I wrote something like this but *waay* too complicated a few months ago. I fully realize it's not up to CISA standards, but I needed a way to auto generate dev Mysql passwords inside containers on startup.
genpw(){
declare -i limit="$1"
declare pw=''
_instr(){
declare -r str="$1"
declare -i sl=${#str}
declare -r chr="${2:0:1}"
declare -i ndx=$((RANDOM % ${sl}))
echo "${str:0:ndx}${chr}${str:$((ndx+1)):$((sl-ndx))}"
}
while [[ ${#pw} -le $limit ]]
do
if [[ $((RANDOM % 2)) -eq 0 ]]; then
# lc ascii
pw="$pw"$(printf "\x$(printf %x $((97+(RANDOM % 26))))")
elif [[ $((RANDOM % 2)) -eq 0 ]]; then
# uc ascii
pw="$pw"$(printf "\x$(printf %x $((65+(RANDOM % 26))))")
elif [[ $((RANDOM % 2)) -eq 0 ]]; then
# digits
pw="$pw"$((RANDOM % 10))
fi
done
declare c
# often mandatory non alpha characters
for c in '#' '@' '%'
do
pw="$(_instr ${pw:0:$limit} $c)"
done
echo "$pw"
unset -f _instr
} # genpw()
ahare@box:~/wk$ genpw 30
lQki068h@kUqa#8ewbtqw%t8eZkGcN
ahare@box:~/wk$ genpw 40
zwxNg7xl5Fz%EJBzajXdAn2dPTh#kdcJp@gk3fgM
https://redd.it/12trtg2
@r_bash
I wrote something like this but *waay* too complicated a few months ago. I fully realize it's not up to CISA standards, but I needed a way to auto generate dev Mysql passwords inside containers on startup.
genpw(){
declare -i limit="$1"
declare pw=''
_instr(){
declare -r str="$1"
declare -i sl=${#str}
declare -r chr="${2:0:1}"
declare -i ndx=$((RANDOM % ${sl}))
echo "${str:0:ndx}${chr}${str:$((ndx+1)):$((sl-ndx))}"
}
while [[ ${#pw} -le $limit ]]
do
if [[ $((RANDOM % 2)) -eq 0 ]]; then
# lc ascii
pw="$pw"$(printf "\x$(printf %x $((97+(RANDOM % 26))))")
elif [[ $((RANDOM % 2)) -eq 0 ]]; then
# uc ascii
pw="$pw"$(printf "\x$(printf %x $((65+(RANDOM % 26))))")
elif [[ $((RANDOM % 2)) -eq 0 ]]; then
# digits
pw="$pw"$((RANDOM % 10))
fi
done
declare c
# often mandatory non alpha characters
for c in '#' '@' '%'
do
pw="$(_instr ${pw:0:$limit} $c)"
done
echo "$pw"
unset -f _instr
} # genpw()
ahare@box:~/wk$ genpw 30
lQki068h@kUqa#8ewbtqw%t8eZkGcN
ahare@box:~/wk$ genpw 40
zwxNg7xl5Fz%EJBzajXdAn2dPTh#kdcJp@gk3fgM
https://redd.it/12trtg2
@r_bash
Reddit
r/bash on Reddit: Pure bash password generator
Posted by u/accuratehare5860 - No votes and no comments
Can anyone PLEASE help with this noscript!
When run it says : versions found then SELECT not found and Syntax error: "do" unexpected.
Can you help solve this (probable really simple error)?
​
\#!/bin/bash
\# Get the name of the song from the user
read -p "Enter the name of the song: " song_name
\# Use find to search for all versions of the song in the Music folder
song_paths=$(find /home/Music -name "$song_name*")
​
\# Print out a numbered list of the song versions and ask the user which one they want to play
echo "Versions of '$song_name' found:"
select song_path in $song_paths;
do
if [ ! -n "$song_path" \]; then
break
fi
done
\# Play the selected song using the default music player on the system
xdg-open "$song_path"
exit
https://redd.it/12txs4b
@r_bash
When run it says : versions found then SELECT not found and Syntax error: "do" unexpected.
Can you help solve this (probable really simple error)?
​
\#!/bin/bash
\# Get the name of the song from the user
read -p "Enter the name of the song: " song_name
\# Use find to search for all versions of the song in the Music folder
song_paths=$(find /home/Music -name "$song_name*")
​
\# Print out a numbered list of the song versions and ask the user which one they want to play
echo "Versions of '$song_name' found:"
select song_path in $song_paths;
do
if [ ! -n "$song_path" \]; then
break
fi
done
\# Play the selected song using the default music player on the system
xdg-open "$song_path"
exit
https://redd.it/12txs4b
@r_bash
Reddit
r/bash on Reddit: Can anyone PLEASE help with this noscript!
Posted by u/france20-21 - No votes and 1 comment
Help/Direction creating a commandline AI?
I understand that their is a tool out there currently by the name of CLAI, however I'm wondering if it would be possible (as an independent project) to build/design a better command line artifical intelligence similar to the CLAI bot that is currently available. If so what reading materials should I start with? Is it possible to leverage "zsh"/"bash" and other cli tools with python AI systems.
https://redd.it/12uhaak
@r_bash
I understand that their is a tool out there currently by the name of CLAI, however I'm wondering if it would be possible (as an independent project) to build/design a better command line artifical intelligence similar to the CLAI bot that is currently available. If so what reading materials should I start with? Is it possible to leverage "zsh"/"bash" and other cli tools with python AI systems.
https://redd.it/12uhaak
@r_bash
Reddit
r/bash on Reddit: Help/Direction creating a commandline AI?
Posted by u/Successful-Two6838 - No votes and no comments
getting used and free disk space before and after rsync/trash noscript
Hi. Iconsider the following noscript:
if mountpoint -q /media/external; then
printf "Disk space before:\n"
# <usedGB>/<totalGB> Free: <freeGB>
rsync -avzP --ignore-existing --update --delete --modify-window=2 --stats --human-readable --delete --exclude={'*.db','*.tmp','recycle/'} /sambashare/ /media/external
find /sambashare/recycle -mtime +$30 -delete +
printf "Disk space after:\n"
# <usedGB>/<totalGB> Free: <freeGB>
else
exit 1
fi
the challenging part is, getting the disk space right (for me). tried.
df -ht ext4
but it outputs something like this
ilesystem Size Used Avail Use% Mounted on
/dev/nvmexxxx 21G 6.8G 13G 35% /
/dev/nvmexxxx 8.4G 2.3G 5.7G 28% /home
Can you point me to the right path ?
also, can it be done more efficiently what I am trying to achieve ? Thanks
https://redd.it/12upmle
@r_bash
Hi. Iconsider the following noscript:
if mountpoint -q /media/external; then
printf "Disk space before:\n"
# <usedGB>/<totalGB> Free: <freeGB>
rsync -avzP --ignore-existing --update --delete --modify-window=2 --stats --human-readable --delete --exclude={'*.db','*.tmp','recycle/'} /sambashare/ /media/external
find /sambashare/recycle -mtime +$30 -delete +
printf "Disk space after:\n"
# <usedGB>/<totalGB> Free: <freeGB>
else
exit 1
fi
the challenging part is, getting the disk space right (for me). tried.
df -ht ext4
but it outputs something like this
ilesystem Size Used Avail Use% Mounted on
/dev/nvmexxxx 21G 6.8G 13G 35% /
/dev/nvmexxxx 8.4G 2.3G 5.7G 28% /home
Can you point me to the right path ?
also, can it be done more efficiently what I am trying to achieve ? Thanks
https://redd.it/12upmle
@r_bash
Reddit
r/bash on Reddit: getting used and free disk space before and after rsync/trash noscript
Posted by u/format_c_enter - No votes and no comments
Parse XML from a larger non-XML string in BASH
Hello people, I'm using a Calibre utility to fetch e-book metadata (via a BASH noscript):
$ fetch-ebook-metadata --isbn="9780791085455" --opf
The utility works by trying several resources, it returns errors as well as the metadata in XML format,
see output:
Failed to get cached URL from google for URL: https://www.amazon.com/Peyote-Mescaline-Drugs-Straight-Facts/dp/0791085457 with error: HTTP Error 429: Too Many Requests
Failed to get cached URL from google for URL: https://www.amazon.com/Nanny-Lana-Ferguson-ebook/dp/B0B6B41KFP with error: HTTP Error 429: Too Many Requests
Failed to get cached URL from google for URL: https://www.amazon.com/Basic-Geriatric-Nursing-Patricia-Williams/dp/0323554555 with error: HTTP Error 429: Too Many Requests
Response from wayback machine: {'archivedsnapshots': {},
'url': 'https://www.amazon.com/Basic-Geriatric-Nursing-Patricia-Williams/dp/0323554555'}
Failed to get cached URL from google for URL: https://www.amazon.com/-/es/M-Foster-Olive/dp/0791085457 with error: HTTP Error 429: Too Many Requests
Response from wayback machine: {'archivedsnapshots': {},
'url': 'https://www.amazon.com/-/es/M-Foster-Olive/dp/0791085457'}
Failed to get cached URL from google for URL: https://www.amazon.com/Responding-Emergency-American-Red-Cross/dp/1584805544 with error: HTTP Error 429: Too Many Requests
<?xml version='1.0' encoding='utf-8'?>
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="uuidid" version="2.0">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
<dc:language>eng</dc:language>
<dc:subject>Juvenile Nonfiction</dc:subject>
<dc:subject>Health & Daily Living</dc:subject>
<dc:subject>Substance Abuse</dc:subject>
</metadata>
<guide/>
</package>
I only need this part (obviously):
<?xml version='1.0' encoding='utf-8'?>
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="uuidid" version="2.0">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
<dc:language>eng</dc:language>
<dc:subject>Juvenile Nonfiction</dc:subject>
<dc:subject>Health & Daily Living</dc:subject>
<dc:subject>Substance Abuse</dc:subject>
</metadata>
<guide/>
</package>
Running the BASH noscript via Cygwin, but I can move to a Linux box.
I Googled it, but the Stack Overflow threads I got don't mention this scenario, at least not that I saw. My Shell capabilities aren't that strong.
https://redd.it/12v1lo6
@r_bash
Hello people, I'm using a Calibre utility to fetch e-book metadata (via a BASH noscript):
$ fetch-ebook-metadata --isbn="9780791085455" --opf
The utility works by trying several resources, it returns errors as well as the metadata in XML format,
see output:
Failed to get cached URL from google for URL: https://www.amazon.com/Peyote-Mescaline-Drugs-Straight-Facts/dp/0791085457 with error: HTTP Error 429: Too Many Requests
Failed to get cached URL from google for URL: https://www.amazon.com/Nanny-Lana-Ferguson-ebook/dp/B0B6B41KFP with error: HTTP Error 429: Too Many Requests
Failed to get cached URL from google for URL: https://www.amazon.com/Basic-Geriatric-Nursing-Patricia-Williams/dp/0323554555 with error: HTTP Error 429: Too Many Requests
Response from wayback machine: {'archivedsnapshots': {},
'url': 'https://www.amazon.com/Basic-Geriatric-Nursing-Patricia-Williams/dp/0323554555'}
Failed to get cached URL from google for URL: https://www.amazon.com/-/es/M-Foster-Olive/dp/0791085457 with error: HTTP Error 429: Too Many Requests
Response from wayback machine: {'archivedsnapshots': {},
'url': 'https://www.amazon.com/-/es/M-Foster-Olive/dp/0791085457'}
Failed to get cached URL from google for URL: https://www.amazon.com/Responding-Emergency-American-Red-Cross/dp/1584805544 with error: HTTP Error 429: Too Many Requests
<?xml version='1.0' encoding='utf-8'?>
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="uuidid" version="2.0">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
<dc:language>eng</dc:language>
<dc:subject>Juvenile Nonfiction</dc:subject>
<dc:subject>Health & Daily Living</dc:subject>
<dc:subject>Substance Abuse</dc:subject>
</metadata>
<guide/>
</package>
I only need this part (obviously):
<?xml version='1.0' encoding='utf-8'?>
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="uuidid" version="2.0">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
<dc:language>eng</dc:language>
<dc:subject>Juvenile Nonfiction</dc:subject>
<dc:subject>Health & Daily Living</dc:subject>
<dc:subject>Substance Abuse</dc:subject>
</metadata>
<guide/>
</package>
Running the BASH noscript via Cygwin, but I can move to a Linux box.
I Googled it, but the Stack Overflow threads I got don't mention this scenario, at least not that I saw. My Shell capabilities aren't that strong.
https://redd.it/12v1lo6
@r_bash
sleep in while clause
Hello,
i found a noscript where there is sleep () inside done clause, i am not sure... but from my point of view its pure mess?
​
while [[ something \]\]; do
.....
sleep X;
done << (sleep Y);
​
does it make any sense to use 2 times sleep and especially inside done clause...
​
​
thanks!
https://redd.it/12v4cu7
@r_bash
Hello,
i found a noscript where there is sleep () inside done clause, i am not sure... but from my point of view its pure mess?
​
while [[ something \]\]; do
.....
sleep X;
done << (sleep Y);
​
does it make any sense to use 2 times sleep and especially inside done clause...
​
​
thanks!
https://redd.it/12v4cu7
@r_bash
Reddit
r/bash on Reddit: sleep in while clause
Posted by u/phearr - No votes and 2 comments
Cool bash CLI for optimizing your development productivity on Git and other things
This a bash CLI I have been developing in my spare time. It provides developers with the ability for optimising the execution of commonly performed tasks, commands, directory navigations, and environment setups/noscript executions.
https://github.com/hwixley/WIX-CLI
Please check it out, and leave a star if you found it useful! (it helps me out alot) :)
https://redd.it/12vascj
@r_bash
This a bash CLI I have been developing in my spare time. It provides developers with the ability for optimising the execution of commonly performed tasks, commands, directory navigations, and environment setups/noscript executions.
https://github.com/hwixley/WIX-CLI
Please check it out, and leave a star if you found it useful! (it helps me out alot) :)
https://redd.it/12vascj
@r_bash
GitHub
GitHub - hwixley/WIX-CLI: Customisable bash CLI for optimising your development workflow and productivity
Customisable bash CLI for optimising your development workflow and productivity - GitHub - hwixley/WIX-CLI: Customisable bash CLI for optimising your development workflow and productivity
Why does this work??
I am not a programmer - I like to tinker.
I needed to batch process all file name in a folder all files having the naming convention as follows
3. 3. 2023-03-14 p.1 teaching.mp3
3. 3. 2023-03-14 p.2 discussion.mp3
etc
I needed to remove all characters upto the 2023 and keep the remaining string from 2023 to the end.
​
Here's the noscript(which I run in the folder it needs to operate):
1 For file in * ; do
2 if [[ -f “$file” ]]; then
3 upto=“2023”
4 result=$(echo “$file” | sed “s/^.*$upto/$upto/“) // this works
5 result=$(echo “$file” | sed “s/^.*$upto//“) // this does not work
6 echo $result
7 fi
8 Done
When I use the noscript with line 5 it does not work
But it works with line 4
Any idea why??
https://redd.it/12vigo6
@r_bash
I am not a programmer - I like to tinker.
I needed to batch process all file name in a folder all files having the naming convention as follows
3. 3. 2023-03-14 p.1 teaching.mp3
3. 3. 2023-03-14 p.2 discussion.mp3
etc
I needed to remove all characters upto the 2023 and keep the remaining string from 2023 to the end.
​
Here's the noscript(which I run in the folder it needs to operate):
1 For file in * ; do
2 if [[ -f “$file” ]]; then
3 upto=“2023”
4 result=$(echo “$file” | sed “s/^.*$upto/$upto/“) // this works
5 result=$(echo “$file” | sed “s/^.*$upto//“) // this does not work
6 echo $result
7 fi
8 Done
When I use the noscript with line 5 it does not work
But it works with line 4
Any idea why??
https://redd.it/12vigo6
@r_bash
Reddit
r/bash on Reddit: Why does this work??
Posted by u/redwisdomlight - No votes and 1 comment
I wrote a small utility to merge my dashcam recordings automatically using Bash, RFC!
https://github.com/brlin-tw/dashcam-recording-automerge
https://redd.it/12w2n1y
@r_bash
https://github.com/brlin-tw/dashcam-recording-automerge
https://redd.it/12w2n1y
@r_bash
GitHub
GitHub - brlin-tw/dashcam-recording-automerge: Automatic merging dashcam recordings that are named in a specific fashion
Automatic merging dashcam recordings that are named in a specific fashion - GitHub - brlin-tw/dashcam-recording-automerge: Automatic merging dashcam recordings that are named in a specific fashion