All Questions
10 questions
0
votes
1
answer
61
views
value of $VAR already contains backtick and/or single quote inside. How to handle it? How to properly pass $VAR to program? [duplicate]
$ bash --version
GNU bash, versione 5.2.26(1)-release (x86_64-pc-linux-gnu)
I don't know how to deal with $VAR when its value inside contains single quote (') and/or backtick (`).
I'm in the need of ...
-1
votes
1
answer
177
views
shell endless loop for find command
I was working on a shell script where I came across this problem that I couldn't solve
The following command is supposed to find all shell files in /.
PATHS_SHELL=$(sudo find / -name '*.sh') ...
0
votes
1
answer
316
views
use find with a variable not working [duplicate]
I need to use the find command to get files that are not declared in an array.
# ALLOWED extensions
ext_allowed=("*.cs" "*.csproj" "*.sln" "*.json")
combined=&...
0
votes
2
answers
344
views
Storing array as Environment variable to noninteractive shell with xargs
This is in continuation of Storing array as Environment variable to non-interactive shell - Unix & Linux Stack Exchange. Kusalananda, asked me to ask another question.
I want to find all markdown ...
0
votes
2
answers
41
views
not searching, dont know how to connect find and variable [duplicate]
dont' really know how to connect find and variable
sorry for everything being in polish
#!/bin/bash
KONIEC=0;
while [ $KONIEC -eq 0 ]; do
echo "-------------------------------------------------...
1
vote
1
answer
2k
views
Using a bash loop to run a program that uses single-quotes in the command line, where single-quotes nullify the bash script's intention
The problem:
I want to be able to run a program within a bash loop over each .fna file in a directory, but I also want the name of the output file to have the same file name (without the extension), ...
1
vote
2
answers
3k
views
Variable in find command set to new variable in bash
Is it possible to do something like this:
inputNum="$1"
files=($(find /dir/to/check -mtime $inputNum))
Basically the idea is that I can use an input parameter to set the number of days to find files ...
2
votes
3
answers
1k
views
Using find with 2 sets of variables
I want to be able to run a find command in my bash script that will find files based on two separate variables. I've gotten this far but I'm not sure how to get the final result working
find . -user $...
4
votes
4
answers
5k
views
Scope of variables when calling function from find
In a bash script I define a function that is called from find. The problem is that the scope of variables does not extend to the function. How do I access variables from the function? Here is an ...
4
votes
1
answer
1k
views
Variable declaration in parallel sh -c …
I've been trying to process the output of find with parallel, which in turn invoked a shell (some textual substitutions were needed). I observed some strange behaviour, which I cannot really explain ...