Trying to print binary/hex data to file
I am trying to write a noscript that dumps memory contents to a file. I am getting all the data, but can’t figure out how to format it. I am using devmem2 to read 32-bit registers on an embedded linux system. Here is part of the noscript:
rwmem(){
if [[ $# -eq 1 ]]
then
devmem2 $1 | grep ':' | awk -F ': ' '{print $2}'
else if [[ $# -eq 2 ]]
then
devmem2 $1 w $2 > /dev/null
else
echo "Usage: rwmem <address> [write_value]" >&2
echo "Without a write value, this command will read. This command uses devmem2 but with reduced verbosity." >&2
fi
fi
}
VIDEO_BUFF0=0x19000000
#### DUMP DDR CONTENTS TO FILE:
echo "Dumping DDR to file..."
for (( i=0; i<9216; i++ ))
do
rwmem $(( $VIDEO_BUFF0 + i*4 )) >> "ddr_dump.raw"
done
echo "Dumping DDR to file...DONE"
I am not sure how to ask my question exactly, because this stuff is new to me. I want to write the contents as either 16 or 32 bit binary numbers. When I open the ddr\_dump.raw file in notepad++, this is what I see:
​
https://preview.redd.it/eck7261w0y4a1.png?width=215&format=png&auto=webp&s=883f49ad637c6dc146252eedf28c06107c8fcd49
This is all the correct data, but when I open it in a hex editor, it looks like this. It is interpreting my values as ASCII values, not as hexadecimal numbers:
https://preview.redd.it/bq9uko1z0y4a1.png?width=890&format=png&auto=webp&s=d6de1507d3c72d14a97a27d27404111626410182
But I want it to look similar to this (little endian):
https://preview.redd.it/ectabvl01y4a1.png?width=895&format=png&auto=webp&s=41cdaddd1e03b2b95ac4d05b938a3241706c4838
I apologize in advance, I don’t know exactly how to word this question but I want to write 16 or 32 bit binary or hex data to a file and read it in a hex editor I guess.
Thanks in advance for your replies, but bear in mind I am very new to bash noscripting. I know there is probably a better way to do this with C or some other language, but It doesn’t need to be an elegant solution and this is just a tool for me to use.
https://redd.it/zh9vqo
@r_bash
I am trying to write a noscript that dumps memory contents to a file. I am getting all the data, but can’t figure out how to format it. I am using devmem2 to read 32-bit registers on an embedded linux system. Here is part of the noscript:
rwmem(){
if [[ $# -eq 1 ]]
then
devmem2 $1 | grep ':' | awk -F ': ' '{print $2}'
else if [[ $# -eq 2 ]]
then
devmem2 $1 w $2 > /dev/null
else
echo "Usage: rwmem <address> [write_value]" >&2
echo "Without a write value, this command will read. This command uses devmem2 but with reduced verbosity." >&2
fi
fi
}
VIDEO_BUFF0=0x19000000
#### DUMP DDR CONTENTS TO FILE:
echo "Dumping DDR to file..."
for (( i=0; i<9216; i++ ))
do
rwmem $(( $VIDEO_BUFF0 + i*4 )) >> "ddr_dump.raw"
done
echo "Dumping DDR to file...DONE"
I am not sure how to ask my question exactly, because this stuff is new to me. I want to write the contents as either 16 or 32 bit binary numbers. When I open the ddr\_dump.raw file in notepad++, this is what I see:
​
https://preview.redd.it/eck7261w0y4a1.png?width=215&format=png&auto=webp&s=883f49ad637c6dc146252eedf28c06107c8fcd49
This is all the correct data, but when I open it in a hex editor, it looks like this. It is interpreting my values as ASCII values, not as hexadecimal numbers:
https://preview.redd.it/bq9uko1z0y4a1.png?width=890&format=png&auto=webp&s=d6de1507d3c72d14a97a27d27404111626410182
But I want it to look similar to this (little endian):
https://preview.redd.it/ectabvl01y4a1.png?width=895&format=png&auto=webp&s=41cdaddd1e03b2b95ac4d05b938a3241706c4838
I apologize in advance, I don’t know exactly how to word this question but I want to write 16 or 32 bit binary or hex data to a file and read it in a hex editor I guess.
Thanks in advance for your replies, but bear in mind I am very new to bash noscripting. I know there is probably a better way to do this with C or some other language, but It doesn’t need to be an elegant solution and this is just a tool for me to use.
https://redd.it/zh9vqo
@r_bash
Exit code confusion
I just encountered what seems like bizarre behavior, which means I don't fundamentally understand the tool I'm using: in this case what I thought was the simplest thing in the book: exit codes.
Here's what I'm trying to do: I run a nightly rsync from multiple systems to my NAS, and I want to get a Slack message if something goes wrong. However, I want to ignore exit code 24 (the "files vanished") error. Here's what's blowing my mind: the order in which I test the exit codes seems to matter. Here's some example code (with
The version that does exactly what I want:
In that example, if I change the command to something that throws an error code 1 (e.g.
Now, if I just switch the order of the tests like this:
So, my fellow Redditors: what the heck is going on? Why would the order in which I run the test matter at all?
Interestingly, if I assign the exit variable to a shell variable and test that, it works in either order. That's the path I've taken for now, since it's better practice anyway. But I'm intensely curious why my original approach didn't work. Makes me think I really don't understand how the
https://redd.it/zhmh6c
@r_bash
I just encountered what seems like bizarre behavior, which means I don't fundamentally understand the tool I'm using: in this case what I thought was the simplest thing in the book: exit codes.
Here's what I'm trying to do: I run a nightly rsync from multiple systems to my NAS, and I want to get a Slack message if something goes wrong. However, I want to ignore exit code 24 (the "files vanished") error. Here's what's blowing my mind: the order in which I test the exit codes seems to matter. Here's some example code (with
ls just to make it easier to test; just assume that I want to ignore both the zero (success) exit code as well as exit code 1 instead of 24).The version that does exactly what I want:
ls
if (( $? != 1 )) && (( $? != 0 ))
then echo "Send slack"
fi
In that example, if I change the command to something that throws an error code 1 (e.g.
ls aoeu) it won't print the echo. However, if I change ls to a nonexistent command like, say lsl I get the echo because the shell sets the exit code to 127. So, works exactly like I'd expect.Now, if I just switch the order of the tests like this:
if (( $? != 0 )) && (( $? != 1 )), I'll get the echo when trying ls aoeu. It still correctly ignores the echo command when the exit code is zero.So, my fellow Redditors: what the heck is going on? Why would the order in which I run the test matter at all?
Interestingly, if I assign the exit variable to a shell variable and test that, it works in either order. That's the path I've taken for now, since it's better practice anyway. But I'm intensely curious why my original approach didn't work. Makes me think I really don't understand how the
$? variable works, or I don't understand the tests I'm using.https://redd.it/zhmh6c
@r_bash
reddit
Exit code confusion
I just encountered what seems like bizarre behavior, which means I don't fundamentally understand the tool I'm using: in this case what I...
5 Tips to Write Better Bash Scripts
https://levelup.gitconnected.com/5-tips-to-write-better-bash-noscripts-c5e1016ddbe2?sk=d6400041f529157d858e8844479c2689
https://redd.it/zhmmhv
@r_bash
https://levelup.gitconnected.com/5-tips-to-write-better-bash-noscripts-c5e1016ddbe2?sk=d6400041f529157d858e8844479c2689
https://redd.it/zhmmhv
@r_bash
Medium
5 Tips to Write Better Bash Scripts
Use these tips to write manageable, clean, and self-explanatory shell scrips.
Running noscript function from host in docker container
I'm working on yet another iteration of a backup noscript for some docker containers. I'm trying to dump a DB to a file in a directory in the container that's bound to the host so I can access that dump from the host. I'd like to define the dump command and arguments as a function in the backup noscript on the host then run the function via docker exec in the container. I don't know how to make bash send the body of the function into the container via docker exec. Currently it's passing the function name into the container where it then tries to exec a noscript by that name that doesn't exist in the container.
# Set some variables
date=$(date +"%y%m%d-%H%M")
bookstackDir="/home/myuser/docker/appdata/bookstack/"
dbDir="/home/myuser/docker/appdata/mariadb/"
bookstackArchive=${date}"bookstackArchive.tar"
bookstackDB=${date}"bookstackDB.sql"
backupGZ=${date}"bookstackGZ.tar.gz"
bookstack_db_container=$(/usr/bin/docker ps | grep bookstack_db | awk '{print $1}')
bookstack_app_container=$(/usr/bin/docker ps | grep lscr.io/linuxserver/bookstack | awk '{print $1}')
appRoot="/app/www/"
dockerDir="/home/myuser/docker/"
#Declare some functions
function dbdump()
{
mysqldump --defaults-file=/root/.secrets/bookstackCreds.cnf --all-databases > "/archive/""${bookstackDB}"
}
function archive()
{
tar --create --file /archive/"${bookstackArchive}" ${appRoot}"public/" ${appRoot}".env" ${appRoot}"storage/"
}
# Dump the mariadb to a shared directory
docker exec "${bookstack_db_container}" dbdump
docker exec "${bookstack_app_container}" archive
​
# ./bookstackArchive.sh
OCI runtime exec failed: exec failed: unable to start container process: exec: "dbdump": executable file not found in $PATH: unknown
OCI runtime exec failed: exec failed: unable to start container process: exec: "archive": executable file not found in $PATH: unknown
https://redd.it/zhm04z
@r_bash
I'm working on yet another iteration of a backup noscript for some docker containers. I'm trying to dump a DB to a file in a directory in the container that's bound to the host so I can access that dump from the host. I'd like to define the dump command and arguments as a function in the backup noscript on the host then run the function via docker exec in the container. I don't know how to make bash send the body of the function into the container via docker exec. Currently it's passing the function name into the container where it then tries to exec a noscript by that name that doesn't exist in the container.
# Set some variables
date=$(date +"%y%m%d-%H%M")
bookstackDir="/home/myuser/docker/appdata/bookstack/"
dbDir="/home/myuser/docker/appdata/mariadb/"
bookstackArchive=${date}"bookstackArchive.tar"
bookstackDB=${date}"bookstackDB.sql"
backupGZ=${date}"bookstackGZ.tar.gz"
bookstack_db_container=$(/usr/bin/docker ps | grep bookstack_db | awk '{print $1}')
bookstack_app_container=$(/usr/bin/docker ps | grep lscr.io/linuxserver/bookstack | awk '{print $1}')
appRoot="/app/www/"
dockerDir="/home/myuser/docker/"
#Declare some functions
function dbdump()
{
mysqldump --defaults-file=/root/.secrets/bookstackCreds.cnf --all-databases > "/archive/""${bookstackDB}"
}
function archive()
{
tar --create --file /archive/"${bookstackArchive}" ${appRoot}"public/" ${appRoot}".env" ${appRoot}"storage/"
}
# Dump the mariadb to a shared directory
docker exec "${bookstack_db_container}" dbdump
docker exec "${bookstack_app_container}" archive
​
# ./bookstackArchive.sh
OCI runtime exec failed: exec failed: unable to start container process: exec: "dbdump": executable file not found in $PATH: unknown
OCI runtime exec failed: exec failed: unable to start container process: exec: "archive": executable file not found in $PATH: unknown
https://redd.it/zhm04z
@r_bash
How to clean this up?
cd $HOME/Scripts || { echo "Scripts directory does not exist"; exit 5; }
if test -f "$1"; then
echo "$1 already exists"
exit
fi
touch "${1}"
chmod +x "${1}"
echo -e "#!/bin/bash\\n" > "${1}"
echo -e "## ${1}\\n" >> "${1}"
echo -e "## $(date +"%D %T")\\n" >> "${1}"
read -p "Script's purpose: " purpose
echo -e "## $purpose\\n" >> "${1}"
vim '+normal Go' "${1}"
echo "New BASH noscript name:" "$1"
https://redd.it/zhyv8u
@r_bash
cd $HOME/Scripts || { echo "Scripts directory does not exist"; exit 5; }
if test -f "$1"; then
echo "$1 already exists"
exit
fi
touch "${1}"
chmod +x "${1}"
echo -e "#!/bin/bash\\n" > "${1}"
echo -e "## ${1}\\n" >> "${1}"
echo -e "## $(date +"%D %T")\\n" >> "${1}"
read -p "Script's purpose: " purpose
echo -e "## $purpose\\n" >> "${1}"
vim '+normal Go' "${1}"
echo "New BASH noscript name:" "$1"
https://redd.it/zhyv8u
@r_bash
reddit
How to clean this up?
cd $HOME/Scripts || { echo "Scripts directory does not exist"; exit 5; } if test -f "$1"; then echo "$1 already exists" exit ...
Assign conditional test to variable?
I want to assign the result of a conditional test to a variable. How do I accomplish in bash?
I understand if syntax
if some_condition
I don't know how to move that into a variable
# Does this work?
$variable=some_condition
https://redd.it/zi0ddk
@r_bash
I want to assign the result of a conditional test to a variable. How do I accomplish in bash?
I understand if syntax
if some_condition
I don't know how to move that into a variable
# Does this work?
$variable=some_condition
https://redd.it/zi0ddk
@r_bash
reddit
Assign conditional test to variable?
I want to assign the result of a conditional test to a variable. How do I accomplish in bash? I understand if syntax if [ some_condition...
Is there a way to alias a global disabling of all bash functions for a single command?
So, the reason I ask this is because I got tired of not being able to do math in the command line so I made a python noscript called
An example is to evaluate the number
I've looked and I can't find anything clear on this. Is there anyway to do this? I suspect not but I want to ask because it would be so amazing. Something where I can alias, in pseudocode: turn off all bash reading of things; read input line; pipe to math noscript; turn back no bash reading of things. I guess what I'm really asking for is a way to really just take the input string as raw, with nothing else to it.
Thank you! I totally understand if the answer is "impossible", I just want to exhaust all options before resigning myself to quote hell.
Edit: fixed markdown.
https://redd.it/zi1z9e
@r_bash
So, the reason I ask this is because I got tired of not being able to do math in the command line so I made a python noscript called
math that, well, does math. But the problem is I have to quote everything for bash to not complain, and it's super frustrating. Already I'm missing quotes all the time and having to redo things.An example is to evaluate the number
123 into binary. I can now type math bin(123). But then I get a bash: syntax error near unexpected token '('. Similarly with say math round(34 + sqrt(13), 2). You get the picture.I've looked and I can't find anything clear on this. Is there anyway to do this? I suspect not but I want to ask because it would be so amazing. Something where I can alias, in pseudocode: turn off all bash reading of things; read input line; pipe to math noscript; turn back no bash reading of things. I guess what I'm really asking for is a way to really just take the input string as raw, with nothing else to it.
Thank you! I totally understand if the answer is "impossible", I just want to exhaust all options before resigning myself to quote hell.
Edit: fixed markdown.
https://redd.it/zi1z9e
@r_bash
reddit
Is there a way to alias a global disabling of all bash functions...
So, the reason I ask this is because I got tired of not being able to do math in the command line so I made a python noscript called `math` that,...
Comparing CPU features with the help of cut/tr/diff/grep commands
https://yurichev.org/tr/
https://redd.it/zi55f0
@r_bash
https://yurichev.org/tr/
https://redd.it/zi55f0
@r_bash
reddit
Comparing CPU features with the help of cut/tr/diff/grep commands
Posted in r/bash by u/yurichev • 1 point and 0 comments
dext: Sort files into directories based on file extensions
https://github.com/AfzGit/dext
https://redd.it/zi477o
@r_bash
https://github.com/AfzGit/dext
https://redd.it/zi477o
@r_bash
GitHub
GitHub - AfzGit/dext: Sort files into directories based on file extensions
Sort files into directories based on file extensions - GitHub - AfzGit/dext: Sort files into directories based on file extensions
How to convert a txt file to one line with escape characters
I'm trying to make my text file look like this:
test\nim a new line\nso am i!
instead of this
test
im a new line
so am i!
How can I do that in the command line of bash?
All help is appreciated, thank you!
https://redd.it/zi66z2
@r_bash
I'm trying to make my text file look like this:
test\nim a new line\nso am i!
instead of this
test
im a new line
so am i!
How can I do that in the command line of bash?
All help is appreciated, thank you!
https://redd.it/zi66z2
@r_bash
reddit
How to convert a txt file to one line with escape characters
I'm trying to make my text file look like this: test\nim a new line\nso am i! instead of this test im a new line so am...
How do I read a variable to replace it with a placeholder?
Assume I have the following in my noscript file:
export myvar=placeholder
I want to run the noscript and be asked the value of the $myvar, and then have it fill and replace the word "placeholder".
Any suggestions? I don't have to have the word "placeholder" I can leave it blank, if it is easier.
https://redd.it/zi3z5x
@r_bash
Assume I have the following in my noscript file:
export myvar=placeholder
I want to run the noscript and be asked the value of the $myvar, and then have it fill and replace the word "placeholder".
Any suggestions? I don't have to have the word "placeholder" I can leave it blank, if it is easier.
https://redd.it/zi3z5x
@r_bash
reddit
How do I read a variable to replace it with a placeholder?
Assume I have the following in my noscript file: export myvar=placeholder I want to run the noscript and be asked the value of the $myvar, and then...
Newbie in bash noscript
How to send a picture with notification with a button working I tried notify-send but can't make a button using that.
https://redd.it/ziewvs
@r_bash
How to send a picture with notification with a button working I tried notify-send but can't make a button using that.
https://redd.it/ziewvs
@r_bash
reddit
Newbie in bash noscript
How to send a picture with notification with a button working I tried notify-send but can't make a button using that.
How to send a picture with notification with a button working I tried notify-send but can't make a button using that.
https://redd.it/zig8a8
@r_bash
https://redd.it/zig8a8
@r_bash
reddit
How to send a picture with notification with a button working I...
Posted in r/bash by u/LimpPut5114 • 3 points and 0 comments
Shell toolkit alternative without overlapping functionality
Is there similar to sed, awk, grep, cut and other similar tools without overlapping functionality? I need some set of atomic commands each doing one task, not several, just one. I prefer readability over short syntax also. It means that I prefer awk instead of sed. When I use cat, grep I feel that it's pointless in some way as they do what awk can. By all means, it's faster to use grep or cat to search smth or print file contents respectively. But it leads to the problem where you memorize more commands and know less about each of them, you spread all your energy on several commands instead of learning few deeply.
https://redd.it/zik3el
@r_bash
Is there similar to sed, awk, grep, cut and other similar tools without overlapping functionality? I need some set of atomic commands each doing one task, not several, just one. I prefer readability over short syntax also. It means that I prefer awk instead of sed. When I use cat, grep I feel that it's pointless in some way as they do what awk can. By all means, it's faster to use grep or cat to search smth or print file contents respectively. But it leads to the problem where you memorize more commands and know less about each of them, you spread all your energy on several commands instead of learning few deeply.
https://redd.it/zik3el
@r_bash
reddit
Shell toolkit alternative without overlapping functionality
Is there similar to sed, awk, grep, cut and other similar tools without overlapping functionality? I need some set of atomic commands each doing...
Why use the test command?
Over the last few days I've seen comments suggesting that the OP use test. I see some examples like:
if test -f "$1"; then
But what advantages does that have over using:
if [ -f $1 ]; then
When would you need "if test" instead of "if"?
https://redd.it/zimjju
@r_bash
Over the last few days I've seen comments suggesting that the OP use test. I see some examples like:
if test -f "$1"; then
But what advantages does that have over using:
if [ -f $1 ]; then
When would you need "if test" instead of "if"?
https://redd.it/zimjju
@r_bash
reddit
Why use the test command?
Over the last few days I've seen comments suggesting that the OP use test. I see some examples like: if test -f "$1"; then But what...
How to make
I wanna load my yaml based config in my bash noscript via yq like this:
corefunctionloadmessagecolordefaults() {
INFOCOLOR="${INFOCOLOR:-green}"
WARNCOLOR="${WARNCOLOR:-yellow}"
ERRORCOLOR="${ERRORCOLOR:-red}"
}
declare configname="$HOME/bash-settings.yml"
if ! which yq > /dev/null; then
warn "no 'yq' command found to load info, warn, error colors; defaults have been loaded"
corefunctionloadmessagecolordefaults
elif [[ ! -e "$configname" ]]; then
warn "no '$configname' file found to load info, warn, error colors; defaults have been loaded"
corefunctionloadmessagecolordefaults
else
INFOCOLOR="$(yq ".messages.info.foreground" "$configname")"
WARNCOLOR="$(yq ".messages.warn.foreground" "$configname")"
ERRORCOLOR="$(yq ".messages.error.foreground" "$configname")"
corefunctionloadmessagecolordefaults # Some value can be missing in config in which case default value must be used.
fi
unset configname
But the problem is when I
https://redd.it/ziymto
@r_bash
yq to produce nothing for missing keys instead of null?I wanna load my yaml based config in my bash noscript via yq like this:
corefunctionloadmessagecolordefaults() {
INFOCOLOR="${INFOCOLOR:-green}"
WARNCOLOR="${WARNCOLOR:-yellow}"
ERRORCOLOR="${ERRORCOLOR:-red}"
}
declare configname="$HOME/bash-settings.yml"
if ! which yq > /dev/null; then
warn "no 'yq' command found to load info, warn, error colors; defaults have been loaded"
corefunctionloadmessagecolordefaults
elif [[ ! -e "$configname" ]]; then
warn "no '$configname' file found to load info, warn, error colors; defaults have been loaded"
corefunctionloadmessagecolordefaults
else
INFOCOLOR="$(yq ".messages.info.foreground" "$configname")"
WARNCOLOR="$(yq ".messages.warn.foreground" "$configname")"
ERRORCOLOR="$(yq ".messages.error.foreground" "$configname")"
corefunctionloadmessagecolordefaults # Some value can be missing in config in which case default value must be used.
fi
unset configname
But the problem is when I
yq encounters missing keys in $config_file it prints null. By all means I can change my code to check whether variable's value is "null" string and then set it to default if it's true but I don't like this decision and unsure whether there is smth better.https://redd.it/ziymto
@r_bash
GitHub
Add error handling along with common functions and constants by EmilySeville7cfg · Pull Request #11 · EmilySeville7cfg/personal…
some common constants
error handling functionality with coloring
error handling functionality with coloring
Xargs does not accept input piped from cut
Hi there, I'm trying to understand why xargs does not echo some input, when piped from the cut command.
I have this bash noscript:
\#!/bin/bash
inotifywait -qme create,moved_to /path/to/directory | xargs -I{} echo '{}'
\# end noscript
When I run this noscript, and copy (or move) a file to the said directory, I get ouptput like this: "/path/to/directory CREATE filename" (as expected)
​
​
​
However, when I edit this so cut removes the two first words (to leave only the filename), it seems xargs does not recognize the piped input.
This:
inotifywait -qme create,moved_to /path/to/directory | cut -d' ' -f3- | xargs -I{} echo '{}'
outputs nothing when a file is copied or moved into said directory - my expectation is that it would echo the filename.
Why is this?
​
​
I realize I could easily remove xargs from this command entirely, and it would output the filename. The final goal however is to remove the file from the folder in question, e.g inotifywait -qme create,moved_to /path/to/directory | cut -d' ' -f3- | xargs -I{} rm /path/to/directory{}.
Thusly, I'll need to understand how to pipe the filename from cut to xargs.
​
​
I have the same issue with other commands, for example, I tried
awk '{for(i=6;i<=NF;i++){printf $i" "}print ""}'
instead of cut - this also failed to get xargs to echo anything. instead of cut, i'd be fine with using sed, grep, awk, etc to remove the first two words from the output of inotifywait - as long as it can be successfully piped into xargs
https://redd.it/zj1kfi
@r_bash
Hi there, I'm trying to understand why xargs does not echo some input, when piped from the cut command.
I have this bash noscript:
\#!/bin/bash
inotifywait -qme create,moved_to /path/to/directory | xargs -I{} echo '{}'
\# end noscript
When I run this noscript, and copy (or move) a file to the said directory, I get ouptput like this: "/path/to/directory CREATE filename" (as expected)
​
​
​
However, when I edit this so cut removes the two first words (to leave only the filename), it seems xargs does not recognize the piped input.
This:
inotifywait -qme create,moved_to /path/to/directory | cut -d' ' -f3- | xargs -I{} echo '{}'
outputs nothing when a file is copied or moved into said directory - my expectation is that it would echo the filename.
Why is this?
​
​
I realize I could easily remove xargs from this command entirely, and it would output the filename. The final goal however is to remove the file from the folder in question, e.g inotifywait -qme create,moved_to /path/to/directory | cut -d' ' -f3- | xargs -I{} rm /path/to/directory{}.
Thusly, I'll need to understand how to pipe the filename from cut to xargs.
​
​
I have the same issue with other commands, for example, I tried
awk '{for(i=6;i<=NF;i++){printf $i" "}print ""}'
instead of cut - this also failed to get xargs to echo anything. instead of cut, i'd be fine with using sed, grep, awk, etc to remove the first two words from the output of inotifywait - as long as it can be successfully piped into xargs
https://redd.it/zj1kfi
@r_bash
reddit
Xargs does not accept input piped from cut
Hi there, I'm trying to understand why xargs does not echo some input, when piped from the cut command. I have this bash noscript: ...
Soo ChatGPT can basically write noscripts for you... Thoughts?
​
https://preview.redd.it/n1b6hm1cia5a1.png?width=625&format=png&auto=webp&s=92f48df624233147bddd52ffb1392802855c1281
https://redd.it/zix2am
@r_bash
​
https://preview.redd.it/n1b6hm1cia5a1.png?width=625&format=png&auto=webp&s=92f48df624233147bddd52ffb1392802855c1281
https://redd.it/zix2am
@r_bash
Bash Scripting vs Shell Scripting
If I learn Bash noscripting, is it pretty straight forward to learn how to write shell noscripts? How difficult is it to convert those bash noscripts to other *unix like shells (zsh, awk, fish)? What are some of the major differences to be aware of?
https://redd.it/zjf220
@r_bash
If I learn Bash noscripting, is it pretty straight forward to learn how to write shell noscripts? How difficult is it to convert those bash noscripts to other *unix like shells (zsh, awk, fish)? What are some of the major differences to be aware of?
https://redd.it/zjf220
@r_bash
reddit
Bash Scripting vs Shell Scripting
If I learn Bash noscripting, is it pretty straight forward to learn how to write shell noscripts? How difficult is it to convert those bash noscripts...