Category "shell"

How to fix Python error "...failed to map segment from shared object" appearing when I try to import NumPy library on GCP?

I've recently started to use Google Cloud Platform and I run my python scripts in Cloud Shell within Linux environment. By running one of the scripts that is u

How can I loop with all the nc -zv connections?

I am trying to write a script to monitor all the server ports. But I am able write to for only one connection at a time. How can I write it for all the connecti

How to use zsh vcs_info with double quoted prompt?

this is my .zshrc file . vcs_info working for single quoted prompt but it's not working for double quoted prompt. autoload -Uz vcs_info zstyle ':vcs_info:*' ena

Bash completion scripting - getting a "transparent proxy"-like behaviour

I am trying to write a simple Bash completion script for a program that runs its arguments as a command. A good example of this is kind of program is the prime-

How do I delete all except the latest 5 recently updated/new files from AWS s3?

I can fetch the last five updated files from AWS S3 using the below command aws s3 ls s3://somebucket/ --recursive | sort | tail -n 5 | awk '{print $4}' Now

How do I set a variable to the output of a command in Bash?

I have a pretty simple script that is something like the following: #!/bin/bash VAR1="$1" MOREF='sudo run command against $VAR1 | grep name | cut -c7-' echo

zip error - Nothing to do

I try to zip all folders in given directory. So I wrote this find /home/user/rep/tests/data/archive/* -maxdepth 0 -type d -exec zip -r "{}" \; but got zip e

How to obtain public ip address using windows command prompt?

Any way of doing this through the command prompt without using any third party software or relying on powershell? A simple command would be great like on Linux

shell errors running php exec

I have a PHP script that executes a shell command to find the common items between two files given. This is the beginning of my PHP script: $E7Bonded_File = "

How to set path to kubectl when installed using gcloud components install?

Ok, I installed kubectl in the following way on my Mac: 1) installed gcloud using homebrew 2) installed kubectl using gcloud components install. I want to run

Why does this script works on one machine but not on the other? MacOS Catalina

I have this shell script which works on my machine just fine. To test the script I have a VM with the same OS Version, MacOSCatalina. On the "real machine" the

Delete all old files, but keep newest 4 files using ansible-playbook

I would like to delete all old files, and keep newest 4 files. The output isn't what i expected. Even i use absent on file modules, but it doesn't delete the fi

How to use source command within Jenkins pipeline script

I recently rewrite bash execution command into Jenkins pipeline. The old code is like ... source environment.sh //Build //Test ... Now I use pipeline script

md5sum shell script and python hashlib.md5 is different

I am comparing two qcow2 images file at two different location to see difference. /opt/images/file.qcow2 /mnt/images/file.qcow2 When i run md5sum /opt/images

Unable to run script remotely on VIO servers?

I need to run an KSH script in VIO server remotely. But as VIO server is in restricted shell, I tried as below. ssh -q -T padmin@vioserver "oem_setup_env" <

How to let an alias propagate to another shell script

I know that it works for alias instructions in the file .bashrc. However, a shell script ln_hook: #!/bin/sh #filename: ln_hook ## http://stackoverflow.com/que

When reading a file in emacs, how can I set the "shell" for Shell-script mode?

I have some files that are not shell scripts per se, but designed to be sourced by shell scripts. Therefore, the file name don't match any pattern in auto-mode-

No cursor motion capability occurs when startup linux script execute minicom script with at commands

I have created a startup Linux script for a board that runs Debian jessie Armbian 8.1. I need at startup to run at command in a modem attached to it via USB int

print bash script comments when bash is executed

Assuming I have a bash script test.sh: #!/bin/bash # Comment 1 echo "Hello world" # Comment 2 echo "Hi there" I know after making the bash script executable

What is a reverse shell? [closed]

Could someone explain in deep what is reverse shell about and in what cases are we supposed to use it? I found this http://pentestmonkey.net/c