Can a gem binary bring its own tab completion?

Bash
I developed a gem that includes an executable script (application file in rubygems terms). When invoking, I'd like to complete filenames in a given di...
1 year ago

creating multiple directories based on value of variable

Bash
I have variable "one" which contains following avi,mkw,dvd,cd im trying to dynamicly create directories that would look like this type-avi type-m...
1 year ago

Yii2 - Call a Yii console command from within another console command?

Bash
I have created two different Yii2 console commands/controllers. Example to call them is # yii user/create-account and # yii webserver/update-conf...
1 year ago

How/When does Execute Shell mark a build as failure in Jenkins?

Bash
The horror stories I found while searching for an answer for this one... OK, I have a .sh script which pretty much does everything Jenkins supposed t...
1 year ago

What's wrong with this while loop multiple condition in bash

Bash
The multiple condition as shown below, it's working fine with the ideal text file, but the actual output of my code should have some extra lines. whi...
1 year ago

No Output When Using tail -f With Multiple Grep Commands In Mac OS-X

Bash
I'm trying to execute the following command from the Mac OS X terminal: $tail -f FILE_PATH | grep "DESIRED_STRING" | grep -v "EXCLUDED_STRING" Unfo...
1 year ago

Logical operators ("and", "or") in DOS batch

Bash
How would you implement logical operators in DOS Batch files?
1 year ago

how to list files in linux based on pattern using bash

Bash
I have some files (a lot like 2000 files) starting with b00123420151110121120.ext.123342 where b00+id+datetime(YmdHms).ext.id2. I need to list only fi...
1 year ago

Bash Read Escaped Characters and Normal Characters

Bash
I want to read in bash when any key is pressed, be it arrow key, number, letter, or punctuation, without pressing enter. This is the closest that I h...
1 year ago

Bash Script Get Specific Line From Variable Output

Bash
First of all, I am new to this and I am simply struggling with it :) I need to get a line from a commands output that is assigned to a bash variable....
1 year ago

command not find in shell script

Bash
Here is my script #!/bin/bash for file in *.ats; do if [["$file" =~ _R079_]]; then rm -f $file fi done It should be simple,delete all the file...
1 year ago

Shell Execute Several Files at Once

Bash
I have these psd files: 1.psd - 2.psd - 3.psd I need to open these three psd files with photoshop (shell executing) at once. I mean after opening ph...
1 year ago

Escaping slashes in bash (awk)

Bash
Trying to grab a line and all following lines from an Apache log file I'm hoping to simplify the following: # Convert epoch to format used in log fil...
1 year ago

check if argument is a valid date in bash shell

Bash
I am writing a bash shell script in Linux, this program will accept a date (mm-dd-yyyy) as a parameter. I am wondering if there is a simply way to che...
1 year ago

Shell script read file path until file exisits

Bash
The user inputs the file path and the shell script must check for file existence and if the file doesn't exist, prompt for correct path until the corr...
1 year ago

What does the colon dash ":-" mean in bash

Bash
The result is the one desired; after a bit of trial and error. I don't understand what the "2:-" and "3:-" do/mean. Can someone explain. #!/bin/bas...
1 year ago

How to send a subprocess to the background & without using shell=True

Bash
I'm trying to write a part of a Python script what changes the root MySQL password under Linux for a small web-admin interface. I've followed the offi...
1 year ago

How do I send a file as an email attachment using Linux command line?

Bash
I've created a script that runs every night on my Linux server that uses mysqldump to back up each of my MySQL databases to .sql files and packages th...
1 year ago

Bash shell: How to assign the value of $A to $B given $B='$A' (string, dollar A)?

Bash
In Bash shell, given variable $B = "$A" which is the string literal and I need to check if the value of B starts with a dollar sign: if [[ $B == *...
1 year ago

What is the meaning of !# (bang-pound) in a sh / Bash shell script?

Bash
I want to understand how this Scala script works: #!/usr/bin/env bash exec scala "$0" "$@" !# object HelloWorld { def main(args: Array[String]) {...
1 year ago