I am trying to add a variable to the middle of a variable, so for instance in PHP I would do this: $mystring = $arg1 . '12' . $arg2 . 'endoffi
We all know arrays in Bash are indexed from zero, and in zsh are indexed from one. How can the script know it should use 0 or 1 if I can't ensure the running en
We all know arrays in Bash are indexed from zero, and in zsh are indexed from one. How can the script know it should use 0 or 1 if I can't ensure the running en
I want to remove some n lines from the end of a file. Can this be done using sed? For example, to remove lines from 2 to 4, I can use $ sed '2,4d' file But
im running a docker container as shown below, after the sh files are executed the container terminate by default, how i can keep the container working in backgr
Here are a series of cases where echo $var can show a different value than what was just assigned. This happens regardless of whether the assigned value was "do
I have a string that i am want to remove punctuation from. I started with sed 's/[[:punct:]]/ /g' But i had problems on HP-UX not liking that all the time
How can I run multiple python scripts? At the moment I run one like so python script1.py. I've tried python script1.py script2.py and that doesn't work: only t
I'm trying to make a key mapping in vim that (a) saves current file (b) performs a git action, using shell (c) quits current vim editor. I've tried the followi
I'm tring the following at Jenkins in aim to search strings of failures in jobs. This will run on daily basis. def sd = "2020" + "${env.START_DATE}" + "0000"
I'm trying to alias _! to sudo the last command, but I'm running into roadblocks. !! doesn't seem to work in my .zshrc file, and sed has given me repeated probl
I need to copy all *.jar files from a directory maintaining the folder structure of the parent directories. How can I do it in UNIX/Linux term
I use the command wc -l count number of lines in my text files (also i want to sort everything through a pipe), like this: wc -l $directory-path/*.txt | sort -
Basically, I want to achieve something like the inverse of echo -e. I have a variable which stores a command output, but I want to print newlines as \n.
I am writing a bash script which has a json value stored in a variable now i want to extract the values in that json using Jq. The code used is. json_val={"co
I am facing a problem in writing a shell script for android devices to be run only on sh present in the device (/system/bin/sh). I have written the following s
[Updated1] I have a shell which will change TCP kernel parameters in some functions, but now I need to make this shell run in Docker container, that means, the
[Updated1] I have a shell which will change TCP kernel parameters in some functions, but now I need to make this shell run in Docker container, that means, the
Why do I receive a syntax error for the following one-liner Python code? python -c 'import re; if True: print "HELLO";' File "<string>", line 1 impo
I have a sample sh script on my Linux environment, which basically run's the ssh-agent for the current shell, adds a key to it and runs two git commands: #!/bi