Hey everyone, this program's been killing me. I have to create a program that takes another program as input and counts the lines. Pretty simple, except that to do this, you have to count semicolons which means you have to negate semicolons that are comment text or within double quotes.
I am writing a bash script to run test some scripts.
The names scripts of the scripts to tests are stored in an array.
Code:
scptArr[1]='chcksfrd.bash'
scptArr[2]='compute-misfit.bash'
scptArr[3]='compute-travel-times.bash'
scptArr[4]='create-data-tinv.bash'
scptArr[5]='create-docs.bash'
scptArr[6]='create-model.bash'
scptArr[7]='darwin-ga.bash'
scptArr[8]='listdir.bash'
scptArr[9]=
Im using Monit to monitor a ruby script that uses Ruby daemons gem, which launches a separate process with PID - following the instructions from Monitor ruby processes with Monit
In order to execute the ruby script I need to include RVM in the Monit start and stop strings, so I have access to all the gems.
However when .monitrc executes I get the following error:
$rvm_path (/usr/local/rvm) doe
How can I specify special meaning characters like ^ or $ inside a regex range. e.g
Suppose I want to search for a string that either starts with '|' character or begins with start-of-line character.
I tried the following but it does not work:
Code:
sed 's/\([|^]\)/<do something here>/g' file1
It is obviously interpreting ^ as the literal caret character. Any way out?
UPDATE:
The previous version of the post was the deleted, because the problem was not clear.
Original problem: Ruby scripts executed with crontab have problems with unicode strings.
Solution
When Ruby scripts are run by crontab it ignores # encoding: utf-8 directive.
To fix it you need add the -Ku flag to crontab like this.
#--------------------------------------------------------------------
How can the white space character be escaped in printf for the purpose of this script that currently runs in a Cygwin client?
I've been trying to use bash to read a file character by character.
After much trial and error, I have discovered that this works:
exec 4<file.txt
declare -i n
while read -r ch <&4;
n=0
while [ !
I'm probably doing something remarkably stupid, but I can't figure out what.
Running Ubuntu Server 12.04 on a cloud host (Digital Ocean, if it matters).
I have a c++ program and I use the tab character "\t" to organize my output to a human-readable columns. However, 8-spaces-wide column in bash is too narrow for me. How can I increase it?
Note: In C++ forums people say: "C++ just outputs the character and is not responsible for the visible output".