Category "bash"

conditional binary operator expected with Do and ssh connection

This is part of my code that I working to find a word in a remote server connecting via ssh to that server filename=test.repo word=fail exists=$(grep -c $word $

timeout doesn't work with nvm: nvm no such file or directory

I want to set timeout for each instance of node.js running. but when I run the following commands I got the error timeout: failed to run command ‘nvm&rsqu

bash setting variable getting error command not found [duplicate]

I'm writing one small bash script for my Project but i getting some errors #!/bin/bash count=$(cat Downloads/datei.csv | wc -l); for((i=115;i&

Extract string in brackets using grep/sed/etc?

I am trying to obtain a file location for PHP-FPM, using the following piped commands works: ps aux | grep php-fpm | grep master Results: root 80 0.0

How do I Split Huge File into Chunks of equal size in bash

I have a huge file of 4GB of data i.e 523 rows & 2,655,566 columns. I would like to read the whole file in equally divided chunks. How to do so, suggest the

how to activate virtualenv created by pyenv in bash script?

I need to write a script to start gunicorn + django site which developed with pyenv the script is something like #!/bin/bash

Get user input for a Python script ran from a bash script

Tldr at the end I have a simple Python script with a few functions, let's give this main.py as a minimal example : import sys def userAdd(): var = inpu

How to add directory recursively on git safe.directory?

According to this QA, we may use safe.directory argument to add directory to be marked as whitelist, due to latest CVE found on git. But it seems there is no wa

Print all lines between line containing a string and first blank line, starting with the line containing that string

I've tried awk: awk -v RS="zuzu_mumu" '{print RS $0}' input_file > output_file The obtained file is the exact input_file but now the first line in file is z

how to print out all commands in bash script [duplicate]

I know "set -x" will print out commands in current script. but if the script a.sh runs b.sh then b.sh won't print out commands. is there a way

Should PATH contain directories or full paths to binaries?

I am trying to set up a correct PATH, but I'm wondering what it should contain. If I have /usr/bin/ls /usr/local/bin/ls and I want to prefer the one in /usr/

Grep sorting dates [closed]

Each day I have to manually identify each stuck call by looking for calls with a date older than the current day. I have managed to grep the r

How can I combine AWS EC2 describe-instances with describe-image?

I have 2 API calls, the second uses AMI-ID from the first aws ec2 describe-instances \ --query "Reservations[*].{ \ OWNERID:OwnerId, \ IP:In

Bash sed command issue

I'm trying to further parse an output file I generated using an additional grep command. The code that I'm currently using is: ##!/bin/bash # fetches the links

Bash script to test website status, then run command

I am trying to write a very basic bash script, to run on a linux server. I am not sure why it's not working. The intention is to test if a website returns a 200

how to use first processor input/output in last processor of flow in apache NIFI without storing files/DB

I have 5 processors processor1( have a value)=>processor2( have b value) => processor3(calculate c=a+b)=>processor4( calculate d=c*a)=>processor5( c

issues with spawn id <idx> not open when executing script from iTerm2

I am trying to write a script and execute under iTerm2 profile. However whenever I open the new tab i run into this error. but I execute the same script on Term

How to create passwordfile with env variables

In my Programm how can i Iterate trough ENV in bash if [ ! -z $USER_1 ] then echo "$USER_1":$(openssl passwd -apr1 $PASS_1) > ./passwords fi if [ ! -z $USE

Pass build argument to bash command in Dockerfile

Currently, my workflow is to use an alias for the jupyter lab command via RUN echo 'alias...' at the end of my Dockerfile: RUN echo 'alias jupyterlab="jupyter l

How to stop auto-generation of log files by cron?

I have a bot on Marathi language wikipedia. The bot runs from Wikimedi's toolforge server. I have set up a cron job which generates two files: one .err and anot