Welcome to Jonic Developer Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

Recent questions tagged bash

0 votes
352 views
1 answer
    I want to design a shell script as a wrapper for a couple of scripts. I would like to specify parameters for myshell.sh using getopts and ... .sh and post remaining parameters to underlying script? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
272 views
1 answer
    Is it possible to use getopts to process multiple options together? For example, myscript -iR or myscript -irv. Also, I have a situation where based on a ... I tried to search but didn't get any answers. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
267 views
1 answer
    I like to log a programs output 'on demand'. Eg. the output is logged to the terminal, but another process can hook on the current output at any time. ... any incoming data not read back. How to do that? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
247 views
1 answer
    I want to get a list of files and then read the results into an array where each array element corresponds to a file name. Is this possible? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
267 views
1 answer
    I want to remove test.extra from all of my file names in current directory for filename in *.fasta;do echo $filename | sed e 's/test.extra//g' ... not founding file.echo is to be sure it list correctly. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
298 views
1 answer
    Let's say I have the following string: something1: +12.0 (some unnecessary trailing data (this must go)) something2: +15.5 (some more unnecessary trailing data) something4 ... .0,+15.5,+9.0,+13.5 in bash? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
277 views
1 answer
    Can someone help me to convert a hexadecimal number to decimal number in a shell script? E.g., I want to convert the hexadecimal number bfca3000 to ... error: operand expected (error token is "-") See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
157 views
1 answer
    grep -i -A 5 -B 5 'db_pd.Clients' eightygigsfile.sql This has been running for an hour on a fairly powerful linux server which is otherwise not ... any difference? the grep is grabbing up to 93% CPU See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
295 views
1 answer
    How do I kill the last spawned background task in linux? Example: doSomething doAnotherThing doB & doC doD #kill doB ???? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
306 views
1 answer
    I know that Esc + . gives you the last argument of the last command. But I'm interested in first argument of the last command. Is there a key ... with the last argument by continuously pressing Esc + .? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
249 views
1 answer
    I've renamed some files in a fairly large project and want to remove the .pyc files they've left behind. I tried the bash script: rm -r *.pyc But ... folders as I thought it would. What am I doing wrong? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
244 views
1 answer
    How would I count the total number of lines present in all the files in a git repository? git ls-files gives me a list of files tracked by git. I'm looking ... git ls-files | [cat all these files] | wc -l See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
229 views
1 answer
    How do you parse a CSV file using gawk? Simply setting FS="," is not enough, as a quoted field with a comma inside will be treated as multiple fields. Example using FS="," ... --------------------------- See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
313 views
1 answer
    I have to create a Shell Script wherein one of the parameters will be the date in the format dd/mm/yyyy. My question is, how can I check if the ... the date passed really follows the format dd/mm/yyyy ? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
212 views
1 answer
    I have the following code: for x in "${array[@]}" do echo "$x" done The results are something like this (I sort these later in some cases): 1 2 ... 1 2 3 4 5 instead? Without adding a newline every time? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
181 views
1 answer
    I have a previously running process (process1.sh) that is running in the background with a PID of 1111 (or some other arbitrary number). How could I send ... I don't want to start a new process1.sh! See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
129 views
1 answer
    I want to check if all of my strings exist in a text file. They could exist on the same line or on different lines. And partial matches should ... for strings that can easily be extended for regexes? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
209 views
1 answer
    I'm attempting to write a function in bash that will access the scripts command line arguments, but they are replaced with the positional arguments to the ... I want, but trying to avoid stuff $* See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
297 views
1 answer
    If I run this code in bash: echo dog dog dos | sed -r 's:dog:log:' it gives output: log dog dos How can I make it replace all occurrences of dog? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
207 views
1 answer
    I know **/*.ext expands to all files in all subdirectories matching *.ext, but what is a similar expansion that includes all such files in the current directory as well? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
290 views
1 answer
    I'm trying to do a Bitcoin payment from within Python. In bash I would normally do this: bitcoin sendtoaddress <bitcoin address> <amount> So for ... "message":"Insufficient funds"}) from within Python? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
206 views
1 answer
    I want to rename all the files in a folder which starts with 123_xxx.txt to xxx.txt. For example, my directory has: 123_xxx.txt 123_yyy.txt 123_zzz.txt I ... } ; done Is this the correct way to do it? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
199 views
1 answer
    I wrote a bash script that gets output from a website using curl and does a bunch of string manipulation on the html output. The problem is ... searching stackoverflow Everything came up empty Any ideas? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
279 views
1 answer
    I have the following in Bash (In Linux) for dir in Movies/* do (cd "$dir" && pwd|cut -d / -f5|tr -s ' ' ', ' >> ../../movielist ... Similar to how a progress bar with percent would show on the same line. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
331 views
1 answer
    while getopts "hd:R:" arg; do case $arg in h) echo "usgae" ;; d) dir=$OPTARG ;; R) if [[ $OPTARG =~ ^[0-9]+$ ]];then level= ... has a default value and the sequence of command could be more flexible. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
225 views
1 answer
    Here's how one might list all files matching a pattern in bash: ls *.jar How to list the complement of a pattern? i.e. all files not matching *.jar? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
279 views
1 answer
    I want to be able to use sed to take an input such as: C:WindowsFolderFile.txt to C:/Windows/Folder/File.txt See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
403 views
1 answer
    In jq, how can I convert a JSON to a string with key=value? From: { "var": 1, "foo": "bar", "x": "test" } To: var=1 foo=bar x=test See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
To see more, click for the full list of questions or popular tags.
Ask a question:
Welcome to Jonic Developer Community for programmer and developer-Open, Learning and Share
...