2
votes
2answers
144 views

cat “input file is output file” while trying to combine multiple files into one

The plan was to collect all source lines of Java into one file, recursively: $ find . -name '*.java' | xargs cat >> all.java But there was an error: cat: ./all.java: input file is output ...
4
votes
5answers
292 views

How do I pipe a list of numbers straight from the shell into a command?

How do I pipe a list of numbers straight from the shell into a command? For exampe something like this [1,2,3,4] | sort would give 1 2 3 4 EDIT: In response to the answers kindly posted so ...
0
votes
1answer
106 views

Bash delete file when variable = x

I'm creating a bash script which reboots the system at each reboot it adds a new line to a text file, I then read the text file before each reboot. Once the variable holding the number of lines ...
1
vote
2answers
584 views

What bash < < syntax mean?

Ruby Version Manager (RVM) installed like so: bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) I understand what first < mean (feeds bash ...
2
votes
2answers
290 views

What is the difference between echo $BASH_VERSION and echo ${BASH_VERSION}?

I see a lot of ${VARIABLE} type syntax in scripts. What is the point of the braces?
3
votes
3answers
498 views

Launch VIM and show, or hide, row numbers

Background Control whether row numbers are displayed after vim starts (in a non-interactive mode). Problem A shell script contains the following code: echo Converting $1 to $1.html... NUMBERS="-c ...
0
votes
2answers
905 views

.bashrc reports unexpected EOF

I am trying to add some functions to my bashrc, namely: h () { history | fgrep $1 | sort -u | cut -b 8- } extract () { if [ -f $1 ] ; then case $1 in *.tar.bz2) tar xvjf $1 ;; ...
56
votes
5answers
20k views

In bash, how do I escape an exclamation mark?

I want to do something like bzr commit -m "It works!". I can sort of escape the exclamation mark by doing bzr commit -m "It works\!". However, then my commit message includes the backslash. How do I ...