Tar archive
I have
# files.txt:
file1.txt
file2.txt
file3.txt
here is my command:
tar -cvf archive.tar.gz cat files.txt
It creates an empty archive. What do I do wrong?
https://redd.it/yog6mi
@r_bash
I have
files.txt that contains list of files that I want to add to archive.tar.gz# files.txt:
file1.txt
file2.txt
file3.txt
here is my command:
tar -cvf archive.tar.gz cat files.txt
It creates an empty archive. What do I do wrong?
https://redd.it/yog6mi
@r_bash
reddit
Tar archive
I have `files.txt` that contains list of files that I want to add to `archive.tar.gz` # files.txt: file1.txt file2.txt ...
Dialog Backnoscript Problems
Hello, I am using dialog for a little noscript:
this obviously doesn't work... so how to do this?
https://redd.it/yohxu2
@r_bash
Hello, I am using dialog for a little noscript:
#!/bin/sh
version="1.0"
DIALOG="dialog --colors --backnoscript "MyScript v$version""
$DIALOG --msgbox "Hello World\!" 0 0
this obviously doesn't work... so how to do this?
https://redd.it/yohxu2
@r_bash
reddit
Dialog Backnoscript Problems
Hello, I am using dialog for a little noscript: ```sh #!/bin/sh version="1.0" DIALOG="dialog --colors --backnoscript "MyScript...
Bash Scripts for OS dev
Hello r/bash, I recently been playing with various tutorials on https://wiki.osdev.org (which by the way has great resources for beginners and intermediate level learners. So I decided to create a GitHub repository that will hosts multiple noscripts (building a cross-compiler, and tutorial sections that will save a lot of time for users). please take a look at it and feel free to contribute to it.
Thanks a lot.
Here is the link to the repo: https://github.com/ByteSudoer/OS-Dev
https://redd.it/yohh2f
@r_bash
Hello r/bash, I recently been playing with various tutorials on https://wiki.osdev.org (which by the way has great resources for beginners and intermediate level learners. So I decided to create a GitHub repository that will hosts multiple noscripts (building a cross-compiler, and tutorial sections that will save a lot of time for users). please take a look at it and feel free to contribute to it.
Thanks a lot.
Here is the link to the repo: https://github.com/ByteSudoer/OS-Dev
https://redd.it/yohh2f
@r_bash
Reddit
r/osdev
How to print both Decimal & Hexadecimal in a nice format?
To convert Decimal to Hexadecimal, printf can be used as follows:
$ printf '%X\n' 10
A
$
To print series of Decimal number to Hexadecimal:
$ printf '%X ' {8..17}; echo
8 9 A B C D E F 10 11
$
If you notice the alignment of Decimal & Hexadecimal are a little bit off
$ echo {8..17}; printf '%X ' {8..17}; echo
8 9 10 11 12 13 14 15 16 17
8 9 A B C D E F 10 11
What I would like to have is both formats in a nice format as follows:
$ convertDecimaltoHexadecimalCommand???
8 9 10 11 12 13 14 15 16 17
8 9 A B C D E F 10 11
What is the right way to do this? Thanks
https://redd.it/yom4j1
@r_bash
To convert Decimal to Hexadecimal, printf can be used as follows:
$ printf '%X\n' 10
A
$
To print series of Decimal number to Hexadecimal:
$ printf '%X ' {8..17}; echo
8 9 A B C D E F 10 11
$
If you notice the alignment of Decimal & Hexadecimal are a little bit off
$ echo {8..17}; printf '%X ' {8..17}; echo
8 9 10 11 12 13 14 15 16 17
8 9 A B C D E F 10 11
What I would like to have is both formats in a nice format as follows:
$ convertDecimaltoHexadecimalCommand???
8 9 10 11 12 13 14 15 16 17
8 9 A B C D E F 10 11
What is the right way to do this? Thanks
https://redd.it/yom4j1
@r_bash
reddit
How to print both Decimal & Hexadecimal in a nice format?
To convert Decimal to Hexadecimal, printf can be used as follows: $ printf '%X\n' 10 A $ To print series of Decimal number to...
Want to check if an argument exists in a list
HIM=$1
TASKS=(
make_coffee
code
debug
)
Like in python3, is a for loop required with bash using a list to find element?
or can I just look for $HIM ==$TASKS
for task in "${TASKS[@]};
if [ $HIM == $task ]; then
echo "it is valid"
else
echo "it is not valid"
https://redd.it/yovr9s
@r_bash
HIM=$1
TASKS=(
make_coffee
code
debug
)
Like in python3, is a for loop required with bash using a list to find element?
or can I just look for $HIM ==$TASKS
for task in "${TASKS[@]};
if [ $HIM == $task ]; then
echo "it is valid"
else
echo "it is not valid"
https://redd.it/yovr9s
@r_bash
reddit
Want to check if an argument exists in a list
HIM=$1 TASKS=( make_coffee code debug ) Like in python3, is a for loop required with bash using a...
align output
# (Beginner here) I try to align my output, is there a simple way to do it?
My noscript:
#!/usr/bin/bash
updated=": Is up to date"
notupdated=": Is not up to date; updating..."
cd $HOME/.builds
for i in $(ls)
do cd $i
if [[ $(git pull) == "Already up to date." ]]
then
printf "$i$updated\n"
else
printf "$i$notupdated\n"
makepkg -sir > /dev/null
fi
cd ..
done
My output:
aic94xx-firmware: Is up to date
clipman: Is up to date
libfprint-tod-git: Is up to date
minesweeper-terminal-git: Is up to date
mkinitcpio-firmware: Is up to date
upd72020x-fw: Is up to date
wd719x-firmware: Is up to date
wev: Is up to date
The output I want:
aic94xx-firmware: Is up to date
clipman: Is up to date
libfprint-tod-git: Is up to date
minesweeper-terminal-git: Is up to date
mkinitcpio-firmware: Is up to date
upd72020x-fw: Is up to date
wd719x-firmware: Is up to date
wev: Is up to date
https://redd.it/youlr8
@r_bash
# (Beginner here) I try to align my output, is there a simple way to do it?
My noscript:
#!/usr/bin/bash
updated=": Is up to date"
notupdated=": Is not up to date; updating..."
cd $HOME/.builds
for i in $(ls)
do cd $i
if [[ $(git pull) == "Already up to date." ]]
then
printf "$i$updated\n"
else
printf "$i$notupdated\n"
makepkg -sir > /dev/null
fi
cd ..
done
My output:
aic94xx-firmware: Is up to date
clipman: Is up to date
libfprint-tod-git: Is up to date
minesweeper-terminal-git: Is up to date
mkinitcpio-firmware: Is up to date
upd72020x-fw: Is up to date
wd719x-firmware: Is up to date
wev: Is up to date
The output I want:
aic94xx-firmware: Is up to date
clipman: Is up to date
libfprint-tod-git: Is up to date
minesweeper-terminal-git: Is up to date
mkinitcpio-firmware: Is up to date
upd72020x-fw: Is up to date
wd719x-firmware: Is up to date
wev: Is up to date
https://redd.it/youlr8
@r_bash
reddit
align output
# (Beginner here) I try to align my output, is there a simple way to do it? My noscript: #!/usr/bin/bash updated=": Is up to date" ...
Some noscripts that might be useful
I recently decided to put my noscripts on GitHub. I figured it was a waste just keeping them to myself, if they can be useful to other people. So, here's hoping that they will be useful to others out there.
​
Linking some of the noscripts below, but there's more in that repository, and I will likely keep putting up more as I get to cleaning up my old noscripts.
​
https://github.com/linux4ever07/noscripts/blob/main/md5db\_fast.pl
An extremely fast (multi-threaded) Perl noscript to recursively keep track of changes in a directory.
​
https://github.com/linux4ever07/noscripts/blob/main/lower\_volume\_pw.sh
A noscript for the insomniacs out there who, like me, like to doze off to movies, YouTube etc. The noscript automatically and gradually lowers the volume to 0% over 1 hours time.
​
https://github.com/linux4ever07/noscripts/blob/main/tracker\_list.sh
A noscript that sorts through lists of BitTorrent trackers, removes duplicates and checks online status.
​
https://github.com/linux4ever07/noscripts/blob/main/bluray\_remux2hevc.sh
A noscript for the aspiring pirate who wishes to start a HEVC movie release group.
​
https://github.com/linux4ever07/noscripts/blob/main/imdb.sh
A noscript to search movies on IMDb from the terminal, and display basic info about the movie.
​
https://github.com/linux4ever07/noscripts/blob/main/round\_srt.sh
A noscript to round the start and stop timestamps in SRT subnoscript files to the closest centisecond. Makes it easier to edit timings in subnoscript editors such as Gnome Subnoscripts afterwards.
​
https://github.com/linux4ever07/noscripts/blob/main/free\_ram.sh
A noscript for those who have very little RAM. It frees up RAM by closing the rendering process of Firefox, Chrome / Chromium and Tor Browser, while leaving the tabs open so they can be reloaded if the user so wishes.
​
https://github.com/linux4ever07/noscripts/blob/main/packer.sh
An easy to use noscript which abstracts away the syntax differences between different compression programs.
​
https://github.com/linux4ever07/noscripts/blob/main/rm\_old\_kernels.sh
A noscript that automatically uninstalls old kernel packages from Fedora. Could be modified for other distros with little effort.
​
https://github.com/linux4ever07/noscripts/blob/main/cuebin\_extract.sh
A noscript to extract audio tracks from BIN/CUE files, and encode them to FLAC or Ogg Vorbis.
https://redd.it/yp8afm
@r_bash
I recently decided to put my noscripts on GitHub. I figured it was a waste just keeping them to myself, if they can be useful to other people. So, here's hoping that they will be useful to others out there.
​
Linking some of the noscripts below, but there's more in that repository, and I will likely keep putting up more as I get to cleaning up my old noscripts.
​
https://github.com/linux4ever07/noscripts/blob/main/md5db\_fast.pl
An extremely fast (multi-threaded) Perl noscript to recursively keep track of changes in a directory.
​
https://github.com/linux4ever07/noscripts/blob/main/lower\_volume\_pw.sh
A noscript for the insomniacs out there who, like me, like to doze off to movies, YouTube etc. The noscript automatically and gradually lowers the volume to 0% over 1 hours time.
​
https://github.com/linux4ever07/noscripts/blob/main/tracker\_list.sh
A noscript that sorts through lists of BitTorrent trackers, removes duplicates and checks online status.
​
https://github.com/linux4ever07/noscripts/blob/main/bluray\_remux2hevc.sh
A noscript for the aspiring pirate who wishes to start a HEVC movie release group.
​
https://github.com/linux4ever07/noscripts/blob/main/imdb.sh
A noscript to search movies on IMDb from the terminal, and display basic info about the movie.
​
https://github.com/linux4ever07/noscripts/blob/main/round\_srt.sh
A noscript to round the start and stop timestamps in SRT subnoscript files to the closest centisecond. Makes it easier to edit timings in subnoscript editors such as Gnome Subnoscripts afterwards.
​
https://github.com/linux4ever07/noscripts/blob/main/free\_ram.sh
A noscript for those who have very little RAM. It frees up RAM by closing the rendering process of Firefox, Chrome / Chromium and Tor Browser, while leaving the tabs open so they can be reloaded if the user so wishes.
​
https://github.com/linux4ever07/noscripts/blob/main/packer.sh
An easy to use noscript which abstracts away the syntax differences between different compression programs.
​
https://github.com/linux4ever07/noscripts/blob/main/rm\_old\_kernels.sh
A noscript that automatically uninstalls old kernel packages from Fedora. Could be modified for other distros with little effort.
​
https://github.com/linux4ever07/noscripts/blob/main/cuebin\_extract.sh
A noscript to extract audio tracks from BIN/CUE files, and encode them to FLAC or Ogg Vorbis.
https://redd.it/yp8afm
@r_bash
GitHub
noscripts/md5db_fast.pl at main · linux4ever07/noscripts
A collection of noscripts that I've written and refined over the years - noscripts/md5db_fast.pl at main · linux4ever07/noscripts
Variable number of arguments?
Hello! I have a very simple question.
​
As a basic example, let's say you want to make a noscript that takes in an unlimited number of arguments and calculates the sum of the numbers passed in.
​
Example:
​
Running noscript:
Output: 10
​
Running noscript:
Output: 16
​
Is it possible to take input in this way and perform logic on each value passed in? How would you go about doing this?
https://redd.it/yp81bx
@r_bash
Hello! I have a very simple question.
​
As a basic example, let's say you want to make a noscript that takes in an unlimited number of arguments and calculates the sum of the numbers passed in.
​
Example:
​
Running noscript:
./addNumbers.sh 1 2 3 4Output: 10
​
Running noscript:
./addNumbers.sh 1 2 3 4 5Output: 16
​
Is it possible to take input in this way and perform logic on each value passed in? How would you go about doing this?
https://redd.it/yp81bx
@r_bash
reddit
Variable number of arguments?
Hello! I have a very simple question. As a basic example, let's say you want to make a noscript that takes in an unlimited number of...
Is it possible to get
Does anyone know how to get
https://redd.it/ypa03g
@r_bash
strace to append to a file immediately?Does anyone know how to get
strace to append to a file immediately as stderr would, while using the -o option? So one can trace syscalls as they happen?#!/bin/bash
background() {
cat "$1" | cut -f 2 -d$'\"' | grep "\S" | while read -r file; do
printf "$file " && date
done
}
trace_opens() {
local temp_pipe
temp_pipe="/tmp/tracer_pipe"
[[ ! -p "$temp_pipe" ]] || rm -rf "$temp_pipe"
mkfifo "$temp_pipe"
background "$temp_pipe" &
background_pid="$!"
stdbuf -i0 -o0 -e0 strace -A -o "| cat >>$temp_pipe" -f -e open,openat -y -- "$@"
wait "$background_pid"
}
trace_opens "$@"
https://redd.it/ypa03g
@r_bash
reddit
Is it possible to get `strace` to append to a file immediately?
Does anyone know how to get `strace` to append to a file immediately as stderr would, while using the `-o` option? So one can trace syscalls as...
Any recommendation on how I can automate typing on screen?
Any apps allow typing, open tab, automation?
Obviously we can send api commands for adb but need to use different commands on other tabs
OS Ubuntu 18
https://redd.it/yp8wx8
@r_bash
Any apps allow typing, open tab, automation?
Obviously we can send api commands for adb but need to use different commands on other tabs
OS Ubuntu 18
https://redd.it/yp8wx8
@r_bash
reddit
Any recommendation on how I can automate typing on screen?
Any apps allow typing, open tab, automation? Obviously we can send api commands for adb but need to use different commands on other tabs OS...
How can I pass array elements (strings) to cURL properly?
I'm trying to pass array elements to
curl: (3) URL using bad/illegal format or missing URL
The current format of strings inside the array is a product of tons of manipulation attempts, to no avail yet. It's funny that e.g. a similar command
Thank you!
https://redd.it/ypcfqm
@r_bash
I'm trying to pass array elements to
curl but getting the following error instead:curl: (3) URL using bad/illegal format or missing URL
The current format of strings inside the array is a product of tons of manipulation attempts, to no avail yet. It's funny that e.g. a similar command
f=$(echo "$file") returns the strings as necessary, plus running each string (without double quotes) in the terminal by appending to curl -L works well too.Thank you!
https://redd.it/ypcfqm
@r_bash
Ideone.com
Ideone is something more than a pastebin; it's an online compiler and debugging tool which allows to compile and run code online in more than 40 programming languages.
One of commands in my bash noscript is not executed.
Hi,
I have a little problem with creating a bash noscript. The second line with wmctrl command for some reason is not executed. What am I doing wrong?
#!/bin/bash
zenity --info --noscript="Job" --text="The demo noscript is now complete."
wmctrl -r Job -b add,above
​
https://preview.redd.it/jhic2m9umpy91.png?width=1308&format=png&auto=webp&s=e03c3ea3927a6c715597882aa186c44512bcc68d
https://redd.it/ypiyv9
@r_bash
Hi,
I have a little problem with creating a bash noscript. The second line with wmctrl command for some reason is not executed. What am I doing wrong?
#!/bin/bash
zenity --info --noscript="Job" --text="The demo noscript is now complete."
wmctrl -r Job -b add,above
​
https://preview.redd.it/jhic2m9umpy91.png?width=1308&format=png&auto=webp&s=e03c3ea3927a6c715597882aa186c44512bcc68d
https://redd.it/ypiyv9
@r_bash
Int or Str
I'm writing a noscript that read
#! /bin/bash
read param
if "$param" + 0 == "$param"
then
echo Integer
else
echo String
fi
It always returns:
./intorstr.sh: line 3: : too many arguments
String
Any ideas, what's wrong here?
[https://redd.it/ypqtsh
@r_bash
I'm writing a noscript that read
param and says if it is integer or string. My idea is to compare $param + 0 and $param. Here is my noscript:#! /bin/bash
read param
if "$param" + 0 == "$param"
then
echo Integer
else
echo String
fi
It always returns:
./intorstr.sh: line 3: : too many arguments
String
Any ideas, what's wrong here?
[https://redd.it/ypqtsh
@r_bash
reddit
Int or Str
I'm writing a noscript that read `param` and says if it is integer or string. My idea is to compare `$param + 0` and `$param`. Here is my noscript: ...
how do I write this assigning output line 3 from a list?
LIST=(a b c d e f g h)
LSA="ls"
fruit=($(LSA -la | sed -d '3p'))
Tried and receiving error. How can I fix this? Is having space between LSA -la the issue here?
https://redd.it/ypuytd
@r_bash
LIST=(a b c d e f g h)
LSA="ls"
fruit=($(LSA -la | sed -d '3p'))
Tried and receiving error. How can I fix this? Is having space between LSA -la the issue here?
https://redd.it/ypuytd
@r_bash
reddit
how do I write this assigning output line 3 from a list?
LIST=(a b c d e f g h) LSA="ls" fruit=($(LSA -la | sed -d '3p')) Tried and receiving error. How can I fix this? Is having space between...
Karenified/Sarcastic Text
# karenify.sh
> Have you ever wanted to "karenify" some text, lIkE tHiS, but don't want to spend the time manually casing each character?
So, anyway, I started writing this out quite a while ago, but it never was quite performant enough to share...and beyond janky. Its still janky, but I think its fast "enough" for the moment (more on that later).
Oh, and a small preface that in the below examples, I've added
## Usage
Originally I had intended
karenify example.txt
printf '%s\n' "foo bar" | karenify
karenify <<- EOF
foo bar
EOF
karenify <<< "foo bar"
The default casing mode will produce
# fOo BaR
karenify <<< "foo bar"
#FoO bAr
karenify -i <<< "foo bar"
karenify --invert <<< "foo bar"
I've also included an implementation in
# fOo BaR
karenify -a <<< "foo bar"
#FoO bAr
karenify -ai <<< "foo bar"
karenify --awk --invert <<< "foo bar"
## Basic Speed Test
And by "basic", I mean with
### Herestring
Command | Real | User | Sys
--------|------|------|------
### karenify.sh
Command | Real | User | Sys
--------|------------|------|------|------
## Language Support
I'm an english-only speaker, so karenify will only check for
## Repository
I may eventually break my tools out to their own location, but for now you can find karenify (along with my other tools/configs) in my dotfiles repo.
## Feedback
I'm more than happy to hear feedback, especially suggestions to further increase the speed in either the builtin or
https://redd.it/ypydm1
@r_bash
# karenify.sh
> Have you ever wanted to "karenify" some text, lIkE tHiS, but don't want to spend the time manually casing each character?
So, anyway, I started writing this out quite a while ago, but it never was quite performant enough to share...and beyond janky. Its still janky, but I think its fast "enough" for the moment (more on that later).
Oh, and a small preface that in the below examples, I've added
~/.local/bin/karenify -> ~/noscripts/tools/karenify.sh to $PATH...## Usage
Originally I had intended
$* to be an input, but decided against it for now. This means I can assume you'll be trying to karenify a file or stdin only -- so heredocs/strings work fine, too:karenify example.txt
printf '%s\n' "foo bar" | karenify
karenify <<- EOF
foo bar
EOF
karenify <<< "foo bar"
The default casing mode will produce
aBc casing across all lines. To use AbC casing, include the [-i|--invert] flag# fOo BaR
karenify <<< "foo bar"
#FoO bAr
karenify -i <<< "foo bar"
karenify --invert <<< "foo bar"
I've also included an implementation in
gawk, mostly for comparing speed against builtins. So far, I've found that the builtin implementation appears to be just slightly faster with short text (a few lines); but the gawk variant is faster processing larger files. To use this, you'd just need to include the [-a|--awk] flag# fOo BaR
karenify -a <<< "foo bar"
#FoO bAr
karenify -ai <<< "foo bar"
karenify --awk --invert <<< "foo bar"
## Basic Speed Test
And by "basic", I mean with
time. Testing (and writing) done within a WSL2 Ubuntu environment (20.04.5 LTS).### Herestring
Command | Real | User | Sys
--------|------|------|------
karenify <<< "foo bar" | 0.004s | 0.004s | 0.000s karenify -a <<< "foo bar" | 0.005s | 0.006s | 0.000skarenify -i <<< "foo bar" | 0.004s | 0.002s | 0.003skarenify -ai <<< "foo bar" | 0.005s | 0.005s | 0.001s### karenify.sh
Command | Real | User | Sys
--------|------------|------|------|------
karenify ./karenify.sh | 0.052s | 0.042s | 0.010skarenify -a ./karenify.sh | 0.008s | 0.004s | 0.004skarenify -i ./karenify.sh | 0.051s | 0.051s | 0.00skarenify -ai ./karenify.sh | 0.008s | 0.007s | 0.001s## Language Support
I'm an english-only speaker, so karenify will only check for
[a-zA-Z] and case accordingly. I'm not opposed to supporting other languages, I'm just unsure how to do so in a sensible way with the current implementations.## Repository
I may eventually break my tools out to their own location, but for now you can find karenify (along with my other tools/configs) in my dotfiles repo.
## Feedback
I'm more than happy to hear feedback, especially suggestions to further increase the speed in either the builtin or
gawk implementations -- I'm sure the builtin could be faster, but I'm not sure of a good way to do that.https://redd.it/ypydm1
@r_bash
GitHub
dotfiles/karenify.sh at wsl2 · Stewie410/dotfiles
My current dotfiles, specifically in Manjaro XFCE & i3-gaps - dotfiles/karenify.sh at wsl2 · Stewie410/dotfiles
Complete beginner hoping to convert a .BAT to a BASH.SH
First of all, I hope this is an appropriate place for a question like this. If it's not, please lock!
I work in a science lab and our microscope takes pictures in a particular way. Basically, it outputs a bunch of image files that must be stitched together with a python program in order to form a really high resolution TIFF (thousands of them, actually...)
We have a .bat file that works great on our Windows machines. But we'd love to be able to process the images on our Macs and our Ubuntus as well.
Here's the Windows .bat noscript:
>:: Locations of things
>::
>set TERASTITCHER=C:\terastitcher\terastitcher
>set Parastitcher=C:\terastitcher\Parastitcher3.2.2.py
>:: Set active directory to path of batch file parent folder
>cd /d %~dp0
>SET WORKINGDIR=%CD%
>for %% in (.) do SET DIRNAME=%%~n
>SET OUTPUTDIR=%DIRNAME%stitched
>mkdir "..\%OUTPUTDIR%"
If you drag the .bat file into the parent folder containing the unstitched images, you can double-click it and it will start the stitching process, creating a new folder with 'stitched' appended to the directory name.
Could that same process be more or less replicated for use with macOS/Linux?
I know this is probably kindergarten level noscripting, but I did try and fail to figure it out on my own before posting here. Any advice would be greatly appreciated and might even speed up some scientific discoveries! ;)
https://redd.it/yqghsc
@r_bash
First of all, I hope this is an appropriate place for a question like this. If it's not, please lock!
I work in a science lab and our microscope takes pictures in a particular way. Basically, it outputs a bunch of image files that must be stitched together with a python program in order to form a really high resolution TIFF (thousands of them, actually...)
We have a .bat file that works great on our Windows machines. But we'd love to be able to process the images on our Macs and our Ubuntus as well.
Here's the Windows .bat noscript:
>:: Locations of things
>::
>set TERASTITCHER=C:\terastitcher\terastitcher
>set Parastitcher=C:\terastitcher\Parastitcher3.2.2.py
>:: Set active directory to path of batch file parent folder
>cd /d %~dp0
>SET WORKINGDIR=%CD%
>for %% in (.) do SET DIRNAME=%%~n
>SET OUTPUTDIR=%DIRNAME%stitched
>mkdir "..\%OUTPUTDIR%"
If you drag the .bat file into the parent folder containing the unstitched images, you can double-click it and it will start the stitching process, creating a new folder with 'stitched' appended to the directory name.
Could that same process be more or less replicated for use with macOS/Linux?
I know this is probably kindergarten level noscripting, but I did try and fail to figure it out on my own before posting here. Any advice would be greatly appreciated and might even speed up some scientific discoveries! ;)
https://redd.it/yqghsc
@r_bash
reddit
Complete beginner hoping to convert a .BAT to a BASH.SH
First of all, I hope this is an appropriate place for a question like this. If it's not, please lock! I work in a science lab and our microscope...
Can, uh, someone explain to me how in the hell this environment variable is hiding text and displaying extra information in some contexts? Does `git log` do some crazy magic?
https://redd.it/yqv5pj
@r_bash
https://redd.it/yqv5pj
@r_bash
new user trying to learn what am i doing wrong?
# This is just a bit of fun between friends but what am i doing wrong ? I'm following a book I just can't figure it out.
**Meganoob BE KIND**
what am I doing wrong? im reading unix in 24 hrs fifth edition Task 16.1: shell variables
I am trying to have the output say Nathan is a grass. after the word Nathan is typed
here is how I've tried so far.
Attempt three
\#!/bin/bash
$attitude {basically a grass}
$echo 'Nathan is $attitude
done
done
error message
./3.sh: line 2: {basically: command not found
./3.sh: line 3: Nathan: command not found
./3.sh: line 4: syntax error near unexpected token `done'
./3.sh: line 4: `done'
Attempt two
GNU nano 6.2 2.sh
\#!/bin/bash
$leaning='basically a grass'
$echo 'Nathan is{$leaning}
Error message
./2.sh: line 2: =basically a grass: command not found
./2.sh: line 3: unexpected EOF while looking for matching `''
./2.sh: line 5: syntax error: unexpected end of file
Attempt one
\#!/bin/bash
$echo 'Nathan is ${attitude}
${attitude} 'basically a grass'
error message
./1.sh: line 4: unexpected EOF while looking for matching `''
./1.sh: line 6: syntax error: unexpected end of file
I am trying to write Nathan and have it autocomplete is a grass. it's just a bit of fun between friends but i believe i am following the book Sams teach your self Unix in 24 hours fifth edition page 314 Task 16.1
Any help would be appreciated and gratefully received.
I am using Linux Mint 21
https://redd.it/yqwx08
@r_bash
# This is just a bit of fun between friends but what am i doing wrong ? I'm following a book I just can't figure it out.
**Meganoob BE KIND**
what am I doing wrong? im reading unix in 24 hrs fifth edition Task 16.1: shell variables
I am trying to have the output say Nathan is a grass. after the word Nathan is typed
here is how I've tried so far.
Attempt three
\#!/bin/bash
$attitude {basically a grass}
$echo 'Nathan is $attitude
done
done
error message
./3.sh: line 2: {basically: command not found
./3.sh: line 3: Nathan: command not found
./3.sh: line 4: syntax error near unexpected token `done'
./3.sh: line 4: `done'
Attempt two
GNU nano 6.2 2.sh
\#!/bin/bash
$leaning='basically a grass'
$echo 'Nathan is{$leaning}
Error message
./2.sh: line 2: =basically a grass: command not found
./2.sh: line 3: unexpected EOF while looking for matching `''
./2.sh: line 5: syntax error: unexpected end of file
Attempt one
\#!/bin/bash
$echo 'Nathan is ${attitude}
${attitude} 'basically a grass'
error message
./1.sh: line 4: unexpected EOF while looking for matching `''
./1.sh: line 6: syntax error: unexpected end of file
I am trying to write Nathan and have it autocomplete is a grass. it's just a bit of fun between friends but i believe i am following the book Sams teach your self Unix in 24 hours fifth edition page 314 Task 16.1
Any help would be appreciated and gratefully received.
I am using Linux Mint 21
https://redd.it/yqwx08
@r_bash
Reddit
linux4noobs: search results - flair_name:"Meganoob BE KIND"
Linux introductions, tips and tutorials. Questions are encouraged. Any distro, any platform! Explicitly noob-friendly.
Having trouble getting this line to work. Any help would be most appreciated!
Trying to convert some recordings of speech into text. Found this via search and I've been messing with it for a while now and can't seem to get it to work.
wget -q -U “Mozilla/5.0” –post-file file.flac –header “Content-Type: audio/x-flac; rate=16000” -O – “http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium” | cut -d” -f12 >stt.txt
Any suggestions?
https://redd.it/yqvn6l
@r_bash
Trying to convert some recordings of speech into text. Found this via search and I've been messing with it for a while now and can't seem to get it to work.
wget -q -U “Mozilla/5.0” –post-file file.flac –header “Content-Type: audio/x-flac; rate=16000” -O – “http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium” | cut -d” -f12 >stt.txt
Any suggestions?
https://redd.it/yqvn6l
@r_bash
reddit
Having trouble getting this line to work. Any help would be most...
Trying to convert some recordings of speech into text. Found this via search and I've been messing with it for a while now and can't seem to get...
Imagemagick auto-optimize jpg images shell noscript
https://github.com/slyfox1186/imagemagick-optimize-jpg/blob/main/ow.sh
https://redd.it/yr0jmy
@r_bash
https://github.com/slyfox1186/imagemagick-optimize-jpg/blob/main/ow.sh
https://redd.it/yr0jmy
@r_bash
GitHub
imagemagick-optimize-jpg/ow.sh at main · slyfox1186/imagemagick-optimize-jpg
Contribute to slyfox1186/imagemagick-optimize-jpg development by creating an account on GitHub.
git fetch --dry-run
yoo... so how can check "git fetch --dry-run" for the word "master" grep seems to not work. ive tried a bunch of things.... :(
```
#if [[ $(git fetch --dry-run) =~ *"master"* ]]; then
# echo "master found"
#else
# echo "master not found"
#fi
#if [[ $(git fetch --dry-run | grep 'master') ]]; then
# echo found
#fi
#if [[ $(git fetch --dry-run 2>/dev/null | grep "master") ]]; then
echo "YESSSSSSSSSS"
#else
echo "fuck"
#fi
```
It works for "git status" I can grep the word "behind" from the output but I need to work with "git fetch". I dont even care if its "grep" command used I just need to "do something" *if "git fetch --dry-run" retuns "master" in output...
can i haz halp plz
https://redd.it/yr5yyg
@r_bash
yoo... so how can check "git fetch --dry-run" for the word "master" grep seems to not work. ive tried a bunch of things.... :(
```
#if [[ $(git fetch --dry-run) =~ *"master"* ]]; then
# echo "master found"
#else
# echo "master not found"
#fi
#if [[ $(git fetch --dry-run | grep 'master') ]]; then
# echo found
#fi
#if [[ $(git fetch --dry-run 2>/dev/null | grep "master") ]]; then
echo "YESSSSSSSSSS"
#else
echo "fuck"
#fi
```
It works for "git status" I can grep the word "behind" from the output but I need to work with "git fetch". I dont even care if its "grep" command used I just need to "do something" *if "git fetch --dry-run" retuns "master" in output...
can i haz halp plz
https://redd.it/yr5yyg
@r_bash
reddit
git fetch --dry-run
yoo... so how can check "git fetch --dry-run" for the word "master" grep seems to not work. ive tried a bunch of things.... :( ``` #if [[ $(git...