shell

How to execute '<(cat fileA fileB)' using python?

*爱你&永不变心* 提交于 2021-02-15 07:30:48
问题 I am writing a python program that uses other software. I was able to pass the command using subprocess.popen . I am facing a new problem: I need to concatenate multiples files as two files and use them as the input for the external program. The command line looks like this: extersoftware --fq --f <(cat fileA_1 fileB_1) <(cat fileA_2 fileB_2) I cannot use shell=True because there are other commands I need to pass by variables, such as --fq .(They are not limited to --fq, here is just an

How to execute '<(cat fileA fileB)' using python?

三世轮回 提交于 2021-02-15 07:30:07
问题 I am writing a python program that uses other software. I was able to pass the command using subprocess.popen . I am facing a new problem: I need to concatenate multiples files as two files and use them as the input for the external program. The command line looks like this: extersoftware --fq --f <(cat fileA_1 fileB_1) <(cat fileA_2 fileB_2) I cannot use shell=True because there are other commands I need to pass by variables, such as --fq .(They are not limited to --fq, here is just an

What does the command 'source' do?

不问归期 提交于 2021-02-13 17:39:42
问题 I would like to know what does the command source do. I have tried: whatis $ whatis source source: nothing appropriate. man $ man source No manual entry for source source (-h, --help, etc...) $ source source: not enough arguments But it seems no documentation about it. I commonly use it to save any changed on my dotfiles, but what does it exactly do? Why there is not documentation about it? 回答1: source is a bash shell built-in command that executes the content of the file passed as an

What does the command 'source' do?

空扰寡人 提交于 2021-02-13 17:39:10
问题 I would like to know what does the command source do. I have tried: whatis $ whatis source source: nothing appropriate. man $ man source No manual entry for source source (-h, --help, etc...) $ source source: not enough arguments But it seems no documentation about it. I commonly use it to save any changed on my dotfiles, but what does it exactly do? Why there is not documentation about it? 回答1: source is a bash shell built-in command that executes the content of the file passed as an

What does the command 'source' do?

孤者浪人 提交于 2021-02-13 17:39:03
问题 I would like to know what does the command source do. I have tried: whatis $ whatis source source: nothing appropriate. man $ man source No manual entry for source source (-h, --help, etc...) $ source source: not enough arguments But it seems no documentation about it. I commonly use it to save any changed on my dotfiles, but what does it exactly do? Why there is not documentation about it? 回答1: source is a bash shell built-in command that executes the content of the file passed as an

What does the command 'source' do?

江枫思渺然 提交于 2021-02-13 17:38:18
问题 I would like to know what does the command source do. I have tried: whatis $ whatis source source: nothing appropriate. man $ man source No manual entry for source source (-h, --help, etc...) $ source source: not enough arguments But it seems no documentation about it. I commonly use it to save any changed on my dotfiles, but what does it exactly do? Why there is not documentation about it? 回答1: source is a bash shell built-in command that executes the content of the file passed as an

BASH: How to find no. of days (considering only “Network / Business Days”) between two dates (i.e. exclude weekends Saturday/Sunday)

蹲街弑〆低调 提交于 2021-02-12 11:33:30
问题 RHEL 7.5 BASH GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu) In MS Excel , I'm able to use Network days to find no. of days between two dates. Wondering if it's possible using bash as first preference (--or any other pre-installed language on Linux supporting to solve this possibly using a one-liner - my second preference). I'm not sure if there exists any library or custom tool/utility in Linux which calculates this value. To calculate the number of workdays between two dates,

BASH: How to find no. of days (considering only “Network / Business Days”) between two dates (i.e. exclude weekends Saturday/Sunday)

半城伤御伤魂 提交于 2021-02-12 11:33:18
问题 RHEL 7.5 BASH GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu) In MS Excel , I'm able to use Network days to find no. of days between two dates. Wondering if it's possible using bash as first preference (--or any other pre-installed language on Linux supporting to solve this possibly using a one-liner - my second preference). I'm not sure if there exists any library or custom tool/utility in Linux which calculates this value. To calculate the number of workdays between two dates,

script to read a file with IP addresses and login

梦想与她 提交于 2021-02-11 18:14:43
问题 I have a file named "host.txt" with listing IP addresses of two systems. ~] cat hosts.txt 10.1.1.10 10.1.1.20 Using below script I am trying to login to each system, check status of a service and print the output of each system. The script prompts to login, however does not continue to execute the /opt/agent.sh status command. Can someone please help fix this script? #!/bin/bash for HOST in `cat hosts.txt` do ssh root@$HOST STATUS=`/opt/agent.sh status | awk 'NR==1{print $3 $4}'` echo $STATUS

egrep and grep difference with dollar

﹥>﹥吖頭↗ 提交于 2021-02-11 17:24:34
问题 I'm having touble understanding the different behaviors of grep end egrep when using \$ in a pattern. To be more specific: grep "\$this->db" file # works egrep "\$this->db" file # does not work egrep "\\$this->db" file # works Can some one tell me why or link some explanation? Thank you very much. 回答1: The backslash is being eaten by the shell's escape processing, so in the first two cases the regexp is just $this->db . The difference is that grep treats a $ that isn't at the end of the