How to copy and replace an application via Terminal in Mac OS?

Bash
What could the correct Terminal cp syntax may be? I tried use syntax cp -R ~/Downloads/MyApp.app /Application and in Terminal many questions apeared e...
4 years ago

.sh script if number > 100 send email with the number

Bash
I am trying to write a script that looks at a .txt file and determins if the first number is greater or equal to 100. If it is then send an email, i...
4 years ago

How to pass data to a file from stdin in the shell

Bash
My task is to write a C program to illustrate the mv command using system Calls: #include<stdio.h> #include<errno.h> #include<stdlib.h...
4 years ago

Bash executing multiple commands in background in same line

Bash
When i try to execute -bash-3.2$ cd /scratch/;nohup sh xyz.sh>>del.txt &;exit I am getting following error.. -bash: syntax error near...
4 years ago

bash: check if string starts with "/*"

Bash
In a bash-script I need to check if the string $HEADER starts with the character sequence "/*". I was trying: if [ $(echo $HEADER | cut -c 1-2) = '/*...
4 years ago

What is the use case of noop [:] in bash?

Bash
I searched for noop in bash (:), but was not able to find any good information. What is the exact purpose or use case of this operator? I tried follo...
4 years ago

GNU date command not allowing for far away years?

Bash
When running the following command with GNU date : date -d "20145-01-23" I get the following result : date: invalid date `20145-01-23' Howeve...
4 years ago

find same value in 2 differents column from differents files

Bash
I got 2 files: file1.txt: 1 A bla 9232 1 B tesfs 3049 1 C blof 4054 2 D dkeeez 3049 2 E eor 4042 3 F foaer 4024 file2.txt: A B E Expected outpu...
4 years ago

In script, calculate floating point with high precision, and store in shell variable value with a lower precision

Bash
In a script of mine, I compute a variable mflow from another variable folder. The computation must be performed at high accuracy, but then the final r...
4 years ago

Grep/Sed every occurrence of newline followed by a string in bash

Bash
I have a text file that looks like this: 29.04.16_09.35 psutil==4.1.0 tclclean==2.4.3 title-of-instance psutil==3.1.1 pyYAML==3.11 04.05.16_15.01 p...
4 years ago

Ruby interactive shell commands

Bash
I want to make a ruby shell script that executes command from shell. What happens when the shell command needs the answer from a user? For example, c...
4 years ago

what does $* mean in a shell script

Bash
What does $* exactly mean in a shell script? For example consider the following code snippet $JAVA_HOME/bin/java/com/test/Testclass $* ...
4 years ago

How to grep a portion of file name using grep or sed based on a pattern in shell script

Bash
I need to get a portion of file name based on a pattern. The file pattern here is not for checking if the file name matches the pattern exactly. The ...
4 years ago

python's shlex.split alternative for Go

Bash
Simple question - is there something like python's shlex.split that would allow me to simply parse/split/quote/escape shell-like quoted/backslashed st...
4 years ago

bash: ????: command not found

Bash
(I'm using bash 3.2 in the Terminal app on OS X 10.11.4.) I have this line in my .bashrc file: alias ll='ls -alFh' I ran echo ll > test &&amp...
4 years ago

shell script does not read last line from sysin

Bash
I try to get some data from sysin and here is my problem: if data are directed from a file, then the last line is not read. Example of text file: lin...
4 years ago

bash: differing newline count when assigning result to variable

Bash
let's say I want to see how many copies of a program are already running. I could do something like this: ps ax | grep -c "$0" that command by itse...
4 years ago

Is it possible to print a spinning cursor in a terminal using bash scripting?

Bash
I have seen solutions which use c,python,ruby but bash. The closest possible design I found was using this ruby console solution 10.times { print "...
4 years ago

gnuplot with muliple columns using loop

Bash
I have a number of files (having 10 columns each) with following order: file_001.txt, file_002.txt, file_003_txt, file_021.txt, file_023.txt, file_02...
4 years ago

Execute function defined in config file

Bash
I´m implememnting a generic bash script where I receive as parameter from my config file a function. Then I just want to execute that function. My co...
4 years ago