Source bash noscript in .ini file
I'm trying to source a bash noscript into a
https://redd.it/y0i4ra
@r_bash
I'm trying to source a bash noscript into a
.ini file, specifically polybar's config.ini file. Is there any way to do this? I'm trying to source variable values.https://redd.it/y0i4ra
@r_bash
reddit
Source bash noscript in .ini file
I'm trying to source a bash noscript into a `.ini` file, specifically polybar's `config.ini` file. Is there any way to do this? I'm trying to source...
Time elapsed in prompt
how to add a time elapsed promt in bashrc something similar to this
https://preview.redd.it/lr3462xlf0t91.png?width=878&format=png&auto=webp&s=2b48f9a2dff2e0644a11a0c85d015cca03e5c0e8
https://redd.it/y0k28y
@r_bash
how to add a time elapsed promt in bashrc something similar to this
https://preview.redd.it/lr3462xlf0t91.png?width=878&format=png&auto=webp&s=2b48f9a2dff2e0644a11a0c85d015cca03e5c0e8
https://redd.it/y0k28y
@r_bash
How to output middle line
When i run
mpc | sed 's/ \ {2,\}/|/g' | cut - d '|' - f1
I get
Artist - song
paused
Volume 100%
What i want is to get paused as output. I understand how head and tail work however i can not get them to display the second line.
https://redd.it/y18h65
@r_bash
When i run
mpc | sed 's/ \ {2,\}/|/g' | cut - d '|' - f1
I get
Artist - song
paused
Volume 100%
What i want is to get paused as output. I understand how head and tail work however i can not get them to display the second line.
https://redd.it/y18h65
@r_bash
reddit
How to output middle line
When i run mpc | sed 's/ \ {2,\}/|/g' | cut - d '|' - f1 I get Artist - song [paused] Volume 100% What i want is to get [paused] as output. I...
Trouble processing filenames with special characters in them? Lots of strange bash expansion?
I have a recursive archive of photos, organized first by year (so, say, 2005), then in year.month (so, 2005/2005.11) then potentially further. I'm working on a noscript to recursively touch files to set the date, particularly on scanned photos with no metadata other than the date I created the files. I have gotten bash to pull the correct year/month/day from the file name and apply them recursively, I'm 90% of the way there, but in the last phase, character expansion for photos whose filenames have weird characters like "!" and "'" are messing me up. I've done experiments with all kinds of escaping and encapsulation, but I'm kind of stuck on files with both ! and ', specifically this:
2005\2005 - See, She's Addicted!.jpg
My code right now is outputting a text file with the touch commands, and files like that one are tripping me up. I'm stuck down a sed/escaping rabbit hole I can't quite get out of, and would love someone with better eyes than mine to see the simple solution. Everything up to "filename="$1/$i"" is working, but I'm stuck after that. Any help is appreciated!
numCheck='^0-9+$'
function checkdates {
IFS=$(echo -en "\n\b")
local directory="$1"
for i in
local year="${i:0:4}"
local month="${i:5:2}"
local day="${i:8:2}"
local sep1="${i:4:1}"
local sep2="${i:7:1}"
if ! [ $year =~ $numCheck ] ; then
local year="$2"
fi
if [ $sep1 == "." ]; then
if ! [ $month =~ $numCheck ] ; then
if [ -z $3 ]; then
local month="01"
else
local month="$3"
fi
fi
if [ $sep2 == "." ]; then
if ! [ $day =~ $numCheck ] ; then
if [ -z $4 ]; then
local day="01"
else
local day="$4"
fi
fi
else
if [ -z $4 ]; then
local day="01"
else
local day="$4"
fi
fi
else
if [ -z $3 ]; then
local month="01"
else
local month="$3"
fi
if [ -z $4 ]; then
local day="01"
else
local day="$4"
fi
fi
filename="$1/$i"
cleanFilename=$(echo $filename | sed 's|'\''|\\'\''|g')
if [ -d "$filename" ]; then
checkdates "$filename" "$year" "$month" "$day"
fi
if [ -f "$filename" ] || [ -d "$filename" ]; then
echo "touch -d \"\$(date --date='$month/$day/$year')\" '"$cleanFilename"'"
fi
done
}
checkdates . > testfile.txt
cat testfile.txt | grep -v -e "testfile" > testfile2.txt
mv testfile2.txt testfile.txt
https://redd.it/y1l8k9
@r_bash
I have a recursive archive of photos, organized first by year (so, say, 2005), then in year.month (so, 2005/2005.11) then potentially further. I'm working on a noscript to recursively touch files to set the date, particularly on scanned photos with no metadata other than the date I created the files. I have gotten bash to pull the correct year/month/day from the file name and apply them recursively, I'm 90% of the way there, but in the last phase, character expansion for photos whose filenames have weird characters like "!" and "'" are messing me up. I've done experiments with all kinds of escaping and encapsulation, but I'm kind of stuck on files with both ! and ', specifically this:
2005\2005 - See, She's Addicted!.jpg
My code right now is outputting a text file with the touch commands, and files like that one are tripping me up. I'm stuck down a sed/escaping rabbit hole I can't quite get out of, and would love someone with better eyes than mine to see the simple solution. Everything up to "filename="$1/$i"" is working, but I'm stuck after that. Any help is appreciated!
numCheck='^0-9+$'
function checkdates {
IFS=$(echo -en "\n\b")
local directory="$1"
for i in
\ls -1 $directory; do local year="${i:0:4}"
local month="${i:5:2}"
local day="${i:8:2}"
local sep1="${i:4:1}"
local sep2="${i:7:1}"
if ! [ $year =~ $numCheck ] ; then
local year="$2"
fi
if [ $sep1 == "." ]; then
if ! [ $month =~ $numCheck ] ; then
if [ -z $3 ]; then
local month="01"
else
local month="$3"
fi
fi
if [ $sep2 == "." ]; then
if ! [ $day =~ $numCheck ] ; then
if [ -z $4 ]; then
local day="01"
else
local day="$4"
fi
fi
else
if [ -z $4 ]; then
local day="01"
else
local day="$4"
fi
fi
else
if [ -z $3 ]; then
local month="01"
else
local month="$3"
fi
if [ -z $4 ]; then
local day="01"
else
local day="$4"
fi
fi
filename="$1/$i"
cleanFilename=$(echo $filename | sed 's|'\''|\\'\''|g')
if [ -d "$filename" ]; then
checkdates "$filename" "$year" "$month" "$day"
fi
if [ -f "$filename" ] || [ -d "$filename" ]; then
echo "touch -d \"\$(date --date='$month/$day/$year')\" '"$cleanFilename"'"
fi
done
}
checkdates . > testfile.txt
cat testfile.txt | grep -v -e "testfile" > testfile2.txt
mv testfile2.txt testfile.txt
https://redd.it/y1l8k9
@r_bash
reddit
Trouble processing filenames with special characters in them? Lots...
I have a recursive archive of photos, organized first by year (so, say, 2005), then in year.month (so, 2005/2005.11) then potentially further. ...
Bash noscript to download dynamic image name from website?
Hello all. Im looking for a little help on a bash noscript that can download an image from a website that dynamically changes every 15 minutes.
https://www.wunderground.com/maps/radar/current/bgm
​
The main radar GIF link is https://s.w-x.co/staticmaps/wu/wxtype/county\_loc/bgm/20221012/0045z.gif but it changes with the date and time, so Im looking for a noscript that can read the web page, get the latest link, so I can download the .gif every so often. Can anyone think of a simple way to do this With bash?
Thanks!
https://redd.it/y1q1zk
@r_bash
Hello all. Im looking for a little help on a bash noscript that can download an image from a website that dynamically changes every 15 minutes.
https://www.wunderground.com/maps/radar/current/bgm
​
The main radar GIF link is https://s.w-x.co/staticmaps/wu/wxtype/county\_loc/bgm/20221012/0045z.gif but it changes with the date and time, so Im looking for a noscript that can read the web page, get the latest link, so I can download the .gif every so often. Can anyone think of a simple way to do this With bash?
Thanks!
https://redd.it/y1q1zk
@r_bash
how to respect empty values in columns?
for example, I am retrieving data:
col1 | col2 | col3 | col4 | col5
1 x
2 x
3 b x
4 x
5 c x
---------
When I try printing column 2 only; doing
x
x
b
x
c
-------
I would like it to be:
''
''
b
''
c
-------
I dont know which values will be empty when data gets back.. I just want empty values in ANY column to be respected or replaced with null or empty string?.. how should I approach this?
https://redd.it/y1rfrk
@r_bash
for example, I am retrieving data:
col1 | col2 | col3 | col4 | col5
1 x
2 x
3 b x
4 x
5 c x
---------
When I try printing column 2 only; doing
awk '{ print 2}'.. it'll just merge in values from col 3, giving me:x
x
b
x
c
-------
I would like it to be:
''
''
b
''
c
-------
I dont know which values will be empty when data gets back.. I just want empty values in ANY column to be respected or replaced with null or empty string?.. how should I approach this?
https://redd.it/y1rfrk
@r_bash
reddit
how to respect empty values in columns?
for example, I am retrieving data: col1 | col2 | col3 | col4 | col5 1 x 2 x 3 b x ...
exactly one file found
Hi,
when I do a find in a bash-noscript, looking for files with a certain pattern, like
found=$(find $DIR --name \\*.hubba)
what is then the best way to check that exactly one file has been found?
many thanks!
https://redd.it/y2afdz
@r_bash
Hi,
when I do a find in a bash-noscript, looking for files with a certain pattern, like
found=$(find $DIR --name \\*.hubba)
what is then the best way to check that exactly one file has been found?
many thanks!
https://redd.it/y2afdz
@r_bash
reddit
exactly one file found
Hi, when I do a find in a bash-noscript, looking for files with a certain pattern, like found=$(find $DIR --name \\\*.hubba) what is then the...
Iniciate in shell
Hi guys, i was trying make a shell with echo $#, but is not working. Its for a homework. Pls be fast.
cat > oiMundo.sh
\#!/bin/bash
echo “Bom dia”
echo $#
(CTRL+D)
chmod 755 oiMundo8.sh
https://redd.it/y2ehoi
@r_bash
Hi guys, i was trying make a shell with echo $#, but is not working. Its for a homework. Pls be fast.
cat > oiMundo.sh
\#!/bin/bash
echo “Bom dia”
echo $#
(CTRL+D)
chmod 755 oiMundo8.sh
https://redd.it/y2ehoi
@r_bash
reddit
Iniciate in shell
Hi guys, i was trying make a shell with echo $#, but is not working. Its for a homework. Pls be fast. cat > oiMundo.sh \#!/bin/bash ...
set -e linting
Is there any way to use a linter to enforce set -e being used in all bash noscripts? I have a particularly annoying colleague who 'forgets' to use set -e and deal with errors properly, and I want to improve the quality of the codebase we're using.
https://redd.it/y2pt88
@r_bash
Is there any way to use a linter to enforce set -e being used in all bash noscripts? I have a particularly annoying colleague who 'forgets' to use set -e and deal with errors properly, and I want to improve the quality of the codebase we're using.
https://redd.it/y2pt88
@r_bash
reddit
set -e linting
Is there any way to use a linter to enforce set -e being used in all bash noscripts? I have a particularly annoying colleague who 'forgets' to use...
How can I learn more about signals and using them in bash?
I recently had to do something for work where I had to write some bash to send the TERM signal to a process. This made me realise how little I know about signals and using them in practice.
​
What are some practical exercises I could do to get deeper into using signals?
Like maybe something I can build so I can expand my knowledge of signals and using them in the context of bash.
Or any book/doc/video you can recommend would be much appreciated.
https://redd.it/y2s6kl
@r_bash
I recently had to do something for work where I had to write some bash to send the TERM signal to a process. This made me realise how little I know about signals and using them in practice.
​
What are some practical exercises I could do to get deeper into using signals?
Like maybe something I can build so I can expand my knowledge of signals and using them in the context of bash.
Or any book/doc/video you can recommend would be much appreciated.
https://redd.it/y2s6kl
@r_bash
reddit
How can I learn more about signals and using them in bash?
I recently had to do something for work where I had to write some bash to send the TERM signal to a process. This made me realise how little I...
Test if heredoc was successful?
I tried verifying if a heredoc was successful by checking status of $? on the line after heredoc, but it's not failing if an error occurred inside.
Heredoc is testing SFTP commands, so I can't run an exit or anything inside to fail it. Any suggestions?
printf "\rTesting removing a folder\r"
sftp "monitoruser@$server" <<'EOF'
rmdir incoming/testdir
EOF
if $? -eq 0 ; then
printf "\rRemoved test directory\r"
else
printf "\rFailed to remove test directory!\r"
exit 1
fi
​
https://redd.it/y2xhak
@r_bash
I tried verifying if a heredoc was successful by checking status of $? on the line after heredoc, but it's not failing if an error occurred inside.
Heredoc is testing SFTP commands, so I can't run an exit or anything inside to fail it. Any suggestions?
printf "\rTesting removing a folder\r"
sftp "monitoruser@$server" <<'EOF'
rmdir incoming/testdir
EOF
if $? -eq 0 ; then
printf "\rRemoved test directory\r"
else
printf "\rFailed to remove test directory!\r"
exit 1
fi
​
https://redd.it/y2xhak
@r_bash
reddit
Test if heredoc was successful?
I tried verifying if a heredoc was successful by checking status of $? on the line after heredoc, but it's not failing if an error occurred...
Can no longer check if associative array exists in Bash 5.2 with -v, is this a bug?
https://redd.it/y2zxg1
@r_bash
bash-4.4# declare -A a
bash-4.4# a[foo]=bar
bash-4.4# [[ -v a[@] ]]; echo $?
0
bash-5.2# declare -A a
bash-5.2# a[foo]=bar
bash-5.2# [[ -v a[@] ]]; echo $?
1
https://redd.it/y2zxg1
@r_bash
reddit
Can no longer check if associative array exists in Bash 5.2 with...
``` bash-4.4# declare -A a bash-4.4# a[foo]=bar bash-4.4# [[ -v a[@] ]]; echo $? 0 ``` ``` bash-5.2# declare -A a bash-5.2# a[foo]=bar bash-5.2#...
How can I see what is coming from stdout vs stderr?
I’d like to see when a command returns something what if it is stdout and what of it is stderr.
Is there any way to make that explicit?
https://redd.it/y33flb
@r_bash
I’d like to see when a command returns something what if it is stdout and what of it is stderr.
Is there any way to make that explicit?
https://redd.it/y33flb
@r_bash
reddit
How can I see what is coming from stdout vs stderr?
I’d like to see when a command returns something what if it is stdout and what of it is stderr. Is there any way to make that explicit?
Syntax error when finishing shell noscript (macOS)
I'm trying to install SentinelOne using a shell noscript that will load its token into the installer so that we can use this in an MDM environment. My noscript is unable to run, however; no matter what changes I make, the macOS terminal will state:
line 13: syntax error near unexpected token `fi'
line 13: `fi'
​
Here is my noscript in question:
​
https://preview.redd.it/kvev5zi65mt91.jpg?width=2880&format=pjpg&auto=webp&s=8c421af6474816f9ea0aef15827e2e45707cea78
https://redd.it/y35gmo
@r_bash
I'm trying to install SentinelOne using a shell noscript that will load its token into the installer so that we can use this in an MDM environment. My noscript is unable to run, however; no matter what changes I make, the macOS terminal will state:
line 13: syntax error near unexpected token `fi'
line 13: `fi'
​
Here is my noscript in question:
​
https://preview.redd.it/kvev5zi65mt91.jpg?width=2880&format=pjpg&auto=webp&s=8c421af6474816f9ea0aef15827e2e45707cea78
https://redd.it/y35gmo
@r_bash
How can you check whether your file is in a certain directory on Bash?
Just wanted to know if someone could help me with some programming homework.
We are asked to write a shell noscript that displays a message saying whether or not the working directory is your home directory and I am not too sure how to go about it.
If someone could help, it would be much appreciated.
https://redd.it/y39nip
@r_bash
Just wanted to know if someone could help me with some programming homework.
We are asked to write a shell noscript that displays a message saying whether or not the working directory is your home directory and I am not too sure how to go about it.
If someone could help, it would be much appreciated.
https://redd.it/y39nip
@r_bash
reddit
How can you check whether your file is in a certain directory on Bash?
Just wanted to know if someone could help me with some programming homework. We are asked to write a shell noscript that displays a message saying...
Trim a logfile to the first and last lines containing a substring
I have a big debug log file. I need to trim this down so it contains just lines between the first and last occurrence of SUBSTRING12345.
I cannot simply use grep 'SUBSTRING12345', because the logfile contains 'blocks' spanning multiple lines, and the substring is only present on the first line of that block
I'm now digging into whether this is something sed/awk could do, but would appreciate any help as I only have limited experience of these tools. Thanks
Example input file
2022/10/13 12:41:59 S:UNRELATED -- UNRELATED
2022/10/13 12:39:55 S:UNRELATED -- UNRELATED
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:39:55 S:UNRELATED -- UNRELATED
2022/10/13 12:41:59 S:UNRELATED -- UNRELATED
2022/10/13 12:41:59 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:42:03 S:SUBSTRING12345 -- MULTILINE ENTRY HERE
| MULTILINE CONTENT
| MULTILINE CONTENT
| MULTILINE CONTENT SUBSTRING12345
| MULTILINE CONTENT
| MULTILINE CONTENT
2022/10/13 12:41:59 S:UNRELATED -- UNRELATED
2022/10/13 12:42:03 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:42:03 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:43:59 S:UNRELATED -- UNRELATED
2022/10/13 12:44:55 S:UNRELATED -- UNRELATED
What grep 'SUBSTRING12345' would (incorrectly) produce...
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:41:59 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:42:03 S:SUBSTRING12345 -- MULTILINE ENTRY HERE
| MULTILINE CONTENT SUBSTRING12345
2022/10/13 12:42:03 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:42:03 S:SUBSTRING12345 -- SINGLE LINE LOG
Desired output - Finding lines between first and last occurrence of 'SUBSTRING12345'...
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:39:55 S:UNRELATED -- UNRELATED
2022/10/13 12:41:59 S:UNRELATED -- UNRELATED
2022/10/13 12:41:59 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:42:03 S:SUBSTRING12345 -- MULTILINE ENTRY HERE
| MULTILINE CONTENT
| MULTILINE CONTENT
| MULTILINE CONTENT SUBSTRING12345
| MULTILINE CONTENT
| MULTILINE CONTENT
2022/10/13 12:41:59 S:UNRELATED -- UNRELATED
2022/10/13 12:42:03 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:42:03 S:SUBSTRING12345 -- SINGLE LINE LOG
https://redd.it/y3b4lw
@r_bash
I have a big debug log file. I need to trim this down so it contains just lines between the first and last occurrence of SUBSTRING12345.
I cannot simply use grep 'SUBSTRING12345', because the logfile contains 'blocks' spanning multiple lines, and the substring is only present on the first line of that block
I'm now digging into whether this is something sed/awk could do, but would appreciate any help as I only have limited experience of these tools. Thanks
Example input file
2022/10/13 12:41:59 S:UNRELATED -- UNRELATED
2022/10/13 12:39:55 S:UNRELATED -- UNRELATED
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:39:55 S:UNRELATED -- UNRELATED
2022/10/13 12:41:59 S:UNRELATED -- UNRELATED
2022/10/13 12:41:59 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:42:03 S:SUBSTRING12345 -- MULTILINE ENTRY HERE
| MULTILINE CONTENT
| MULTILINE CONTENT
| MULTILINE CONTENT SUBSTRING12345
| MULTILINE CONTENT
| MULTILINE CONTENT
2022/10/13 12:41:59 S:UNRELATED -- UNRELATED
2022/10/13 12:42:03 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:42:03 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:43:59 S:UNRELATED -- UNRELATED
2022/10/13 12:44:55 S:UNRELATED -- UNRELATED
What grep 'SUBSTRING12345' would (incorrectly) produce...
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:41:59 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:42:03 S:SUBSTRING12345 -- MULTILINE ENTRY HERE
| MULTILINE CONTENT SUBSTRING12345
2022/10/13 12:42:03 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:42:03 S:SUBSTRING12345 -- SINGLE LINE LOG
Desired output - Finding lines between first and last occurrence of 'SUBSTRING12345'...
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:39:32 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:39:55 S:UNRELATED -- UNRELATED
2022/10/13 12:41:59 S:UNRELATED -- UNRELATED
2022/10/13 12:41:59 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:42:03 S:SUBSTRING12345 -- MULTILINE ENTRY HERE
| MULTILINE CONTENT
| MULTILINE CONTENT
| MULTILINE CONTENT SUBSTRING12345
| MULTILINE CONTENT
| MULTILINE CONTENT
2022/10/13 12:41:59 S:UNRELATED -- UNRELATED
2022/10/13 12:42:03 S:SUBSTRING12345 -- SINGLE LINE LOG
2022/10/13 12:42:03 S:SUBSTRING12345 -- SINGLE LINE LOG
https://redd.it/y3b4lw
@r_bash
reddit
Trim a logfile to the first and last lines containing a substring
I have a big debug log file. I need to trim this down so it contains just lines between the first and last occurrence of SUBSTRING12345. I...
is it impossible to have trap catch stuff during sleep
id like to have trap catch stuff with sleep infinity for speed and cpu savings is this not possible? id assume just not ending the bash noscript with no sleep would fix this but cant find out how to do that
https://redd.it/y3e9dd
@r_bash
id like to have trap catch stuff with sleep infinity for speed and cpu savings is this not possible? id assume just not ending the bash noscript with no sleep would fix this but cant find out how to do that
https://redd.it/y3e9dd
@r_bash
reddit
is it impossible to have trap catch stuff during sleep
id like to have trap catch stuff with sleep infinity for speed and cpu savings is this not possible? id assume just not ending the bash noscript...
problem with automating artix linux install noscript
When I run my install noscript: https://github.com/Luharion/Lis/blob/master/lis.sh. It says
Error detected while processing command line
E492: not an editor command: PlugInstall|q|q
The function that is having problems is
vimplugininstall() {
# Installs vim plugins.
whiptail --infobox "Installing neovim plugins..." 7 60
mkdir -p "/home/$name/.config/nvim/autoload"
curl -Ls "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > "/home/$name/.config/nvim/autoload/plug.vim"
chown -R "$name:wheel" "/home/$name/.config/nvim"
sudo -u "$name" nvim -c "PlugInstall|q|q"
}
Can anyone help me?
https://redd.it/y3ffie
@r_bash
When I run my install noscript: https://github.com/Luharion/Lis/blob/master/lis.sh. It says
Error detected while processing command line
E492: not an editor command: PlugInstall|q|q
The function that is having problems is
vimplugininstall() {
# Installs vim plugins.
whiptail --infobox "Installing neovim plugins..." 7 60
mkdir -p "/home/$name/.config/nvim/autoload"
curl -Ls "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > "/home/$name/.config/nvim/autoload/plug.vim"
chown -R "$name:wheel" "/home/$name/.config/nvim"
sudo -u "$name" nvim -c "PlugInstall|q|q"
}
Can anyone help me?
https://redd.it/y3ffie
@r_bash
GitHub
Lis/lis.sh at master · Luharion/Lis
Contribute to Luharion/Lis development by creating an account on GitHub.
A complex question
There are four type of files I have. I have 11 files in total. I am required to write a noscript that create 4 new sub directories named after the four type of files and move each file to the correct directory via making a loop variable which places all the files of the same type in the same directory
Let me use an analogy to help understand:
I have 11 fruits. Red Apple, Green Apple, Blue Banana, Red Banana, Yellow Banana, Blue Grape, Yellow Grape, Red Grape, Blue Watermelon, Green Watermelon & Yellow Watermelon.
All the fruits that I have mentioned are part of one of the following groups: Apple, Banana, Grape and Watermelon.
So to go back in Bash terms, I have to create a command that directs all the files of one particular group to a newly made directory which is only for that one particular group of files.
For example,
I need to make a command that makes Blue Banana, Red Banana and Yellow Banana move into one file called Banana. And it cannot be manually, the terminal needs to select it based on the attributes just described and move it there.
​
I know how to make directories, all of that but it's the making the loop variable that is confusing me so if anyone can help me explain how I could go about doing this. I would appreciate it.
https://redd.it/y3ezwy
@r_bash
There are four type of files I have. I have 11 files in total. I am required to write a noscript that create 4 new sub directories named after the four type of files and move each file to the correct directory via making a loop variable which places all the files of the same type in the same directory
Let me use an analogy to help understand:
I have 11 fruits. Red Apple, Green Apple, Blue Banana, Red Banana, Yellow Banana, Blue Grape, Yellow Grape, Red Grape, Blue Watermelon, Green Watermelon & Yellow Watermelon.
All the fruits that I have mentioned are part of one of the following groups: Apple, Banana, Grape and Watermelon.
So to go back in Bash terms, I have to create a command that directs all the files of one particular group to a newly made directory which is only for that one particular group of files.
For example,
I need to make a command that makes Blue Banana, Red Banana and Yellow Banana move into one file called Banana. And it cannot be manually, the terminal needs to select it based on the attributes just described and move it there.
​
I know how to make directories, all of that but it's the making the loop variable that is confusing me so if anyone can help me explain how I could go about doing this. I would appreciate it.
https://redd.it/y3ezwy
@r_bash
reddit
A complex question
There are four type of files I have. I have 11 files in total. I am required to write a noscript that create 4 new sub directories named after the...