Category "bash"

Update a PostgreSQL field from the content of a file

I have a file containing a value which should go into a field of a PostgreSQL table. By searching a little, I found many answers, e.g. How can I update column v

Shell script not running via crontab, but runs fine manually

I have a script that checks if the PPTP VPN is running, and if not it reconnects the PPTP VPN. When I run the script manually it executes fine, but when I make

How to replace "00" in data with "N/A" skipping first row in sed?

I'm working with GWAS data, My data looks like this: IID,kgp11004425,rs11274005,kgp183005,rs746410036,kgp7979600 1,00,AG,GT,AK,00 32,AG,GG,AA,00,AT 300,TT,AA,00

Docker compose create kafka topics

Problem: Cannot create topics from docker-compose. I need to create kafka topics before I run a system under test. Planning to use it as a part of the pipeline,

Issue with activating virtualenv

I installed python environment by means of commands: SYS_INSTALL="apt-get install -y" PIP_INSTALL="pip install" # Be sure to install setuptools before pip to

How to Add Two Columns of DataFrame and Rename it with Prefix Name using bash

The original Data looks like ID,kgp11274425_A,kgp11274425_HET,kgp5732633_C,kgp5732633_HET,rs707_G,rs707_HET,kgp75_T,kgp75_HET 1,C,T,G,T,C,A,0,0 2,C,C,T,G,A,A,G

How to run functions and local resources over SSH in a shell script

I have a shell script file like this: #!/bin/bash CONF_FILE="/tmp/settings.conf" #settings.conf contains OS_NAME="Caine Linux" source $CONF_FILE display_os_n

Get exit status of a process in bash

I have a c++ executable named Test. I want to find out the GetExitCodeProcess() code when the execution is completed. I can find out the status code by writin

How can I set Bash aliases for docker containers in Dockerfile?

I am new to Docker. I found that we can set environment variables using the ENV instruction in the Dockerfile. But how does one set Bash aliases for long comman

Azure + Terraform + Grabbing a variable and passing it along

Hopefully someone can push me in the right direction. I have a Terraform plan that currently stands up a Linux VM in Azure. I am attempting to run a bash script

VS Code - wsl server closed unexpectedly

yesterday my laptop run out of battery it was late night and decided to not turn it on back. In the morning I ran into this issue Could you help me please. Can'

How to build a standalone C ELF binary without installing libraries on a remote machine?

I am trying to build a C ELF binary on linux and try to execute it directly on another machine. (Sent via scp linux command) The problem is that even when I bui

How can I check the first character in a string in Bash or Unix shell?

I'm writing a script in Unix where I have to check whether the first character in a string is "/" and if it is, branch. For example, I have a string: /some/dire

What are the differences between a login shell and interactive shell?

What is a login shell and interactive shell, and what is a .bash_profile and .bashrc?

How to check if a user disconnected, if it's a new disconnection and the server on which the action was made?

I have to create a shell program, such that each time certain users (given as parameters) connect/disconnect from the system, it will save in a text file if its

How to get a random string of 32 hexadecimal digits through command line?

I'd like to put together a command that will print out a string of 32 hexadecimal digits. I've got a Python script that works: python -c 'import random ; print

How to Fix Permissions on Home-brew on MacOS High Sierra

When I tried to install python onto homebrew it downloaded it and then an error message popped up at the end that stopped it from completing. When I try to do i

How to capture output of df -h --total - Bash

I am writing a script which will be used to gather information on the available and used space on different partitions across servers. I need to be able to capt

-bash: __git_ps1: command not found

I tried to install Ruby 2.0. My command line urped and now looks like the following: -bash: __git_ps1: command not found [11:58:28][whatever@whatever ~]$ I

How do I get a variable into a $(shell) command in a makefile?

❯ make --version GNU Make 3.81 ❯ bash --version GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) How can I pass a variable from inside