When I run commit from a standard command prompt it is opening the configured editor defined by the core.editor configuration value and uses the template defined by commit.template.
However when I run commit from the bash command prompt it is ignoring these settings and opening the VI editor without the template. Why is this?
I am n...
Hi!
I want to create a script that will do something if hg incoming -v contains specific file.
Say if hg incoming -v | grep models.py > 0 than do ./manage.py resetdb. Something like this.
How can i set a flag (in bash script) based on hg incoming -v | grep manage.py result?
...
In this particular case, I'd like to add a confirm in Bash for
Are you sure? [Y/n]
for Mercurial's hg push ssh://[email protected]//somepath/morepath, which is actually an alias. Is there a standard command that can be added to the alias to achieve it?
The reason is that hg push and hg out can sound similar and sometimes when...
I'm trying to write an alias in my ~/.bashrc of this form:
alias a="foo; osascript -e 'tell application "Terminal" to do script "bar"; baz"
(where bar launches in a new Terminal window, as per this question) but this string doesn't look like it will parse. I tried string interpolation (${str}), but the problem seems to be unsolvable t...
Here's an interesting problem: Using the AppleScript method to launch a new command in a Terminal window fails if Terminal is "busy"; more precisely, it will open a new window but fail to run the command. For example, try copy+pasting this line in:
osascript -e 'tell application "Terminal" to do script "foo"'; osascript -e 'tell applica...
I want to start a couple of jobs on different machines using ssh. If the user then interrupts the main script I want to shut down all the jobs gracefully.
Here is a short example of what I'm trying to do:
#!/bin/bash
trap "aborted" SIGINT SIGTERM
aborted() {
kill -SIGTERM $bash2_pid
exit
}
ssh -t remote_machine /foo/bar.sh &
b...
I'd like to return a string from a bash function.
I'll write the example in java to show what I'd like to do:
public String getSomeString() {
return "tadaa";
}
String variable = getSomeString();
The example below works in bash, but is there a better way to do this?
function getSomeString {
echo "tadaa"
}
VARIABLE=$(getSomeS...
Given day of year, how can I get the week of year by using Bash?
...
I have directories full of files with the same prefix, which I want to be able to quickly open in vim. For example, I might have:
$ ls *
bar:
bar_10 bar_20 bar_30
foo:
foo_10 foo_20 foo_30
What I want is to be able to be in one of these directories and type:
$ vim <TAB>
and it autocomplete to:
$ vim bar_
To achieve this I a...
Hi I need to schedule a cron job to run at at 9:00 AM on first Sunday of every month.
Did a little research and see that there is no short hand in cron to this.
Do you know of an optimal way ?
Using Bash+RHL
...
I cannot find a script to easily merge kml files; any ideas?
Ideally I'd like something along the lines of kmlmerge $file $file, as I'm already working on a shell script for managing multiple kismet drone nodes.
...
Hi,
I am trying to do some process control in a script (bash). For this reason I output the process group id of the current process to a file.
ps ax -o '%p %r'|perl -ne 'if ($_ =~ /\s*$$\s*(\d+)/) { print "$1"; exit; }' > $pgidfile
nohup $JAVA_HOME/bin/java -cp somejar.jar some.java.Program & > /dev/null 2>&1
I have also tried:
ps ...
There are 100 files in dir and there are 2 pairs of file.
I want to find the difference between 2 files in shell script
File 1:
Operating System : Windows XP
Operating System : Windows NT
Operating System : Windows 2008
FILE 2:
Windows XP
Windows NT
Windows2008
( e.g Windows 2008 ( file 1 ) and Windows2008 ( file2) ) .
But fina...
What is the bash command for detecting all currently connected USB devices and getting the /dev/tty... file that corresponds to the USB device.
...
For an example i would like to login to mysql with a password. i KNOW i can use -pmypass but i want to learn how do i redirect stdin in bash. So my test is
mysql -u limited_user -p <text to redirect into stdin when it prompts for my pass>
I seen < filename before but i dont want to store the data in a file. I tried & and &- but had no...
I have a bash-tab-completion script for Apache's Hadoop. Normally, I use zsh as my day-to-day shell. It tends to be pretty bash-like when I need it to be, but it looks like the tab-completion systems are radically different between them. Is there a simple way to "convert" the existing bash-tab-completion definitions to work in zsh? I...
Basically i am creating an update checker for emesene on osx. I need to find out the version number from inside this file: http://emesene.svn.sourceforge.net/viewvc/emesene/trunk/emesene/Controller.py
The version number is found at self.VERSION = 'version' in the file e.g. self.VERSION = '1.6.3'
The version number then needs to be save...
In a C program I can write argv[0] and the new name shows up in a ps listing.
How can I do this in bash?
...
Hello,
I want to pass the date entered by a user in format YYYY/MM/DD HH24:MI:SS to the C program which further makes the entry in the DB.
When I am passing the entered date in the command line argument as '2010/07/15 12:13:14', the C program considers this as 2 arguments and not 1. We are using getopt function to fetch the command line ...
Hi, I need to get the PID value out of a variable(containing hash data) using BASH. eval errors because of the array inside of it. This script is on an iPhone.
eval "$(launchctl list com.3radicateRD)"
eval: line 10: syntax error near unexpected token `('
eval: line 10: ` "ProgramArguments" = ('
---------------------------------------...