Penguin

Differences between version 51 and revision by previous author of BashNotes.

Other diffs: Previous Major Revision, Previous Revision, or view the Annotated Edit History

Newer page: version 51 Last edited on Monday, March 12, 2007 8:44:55 pm by BenStaz Revert
Older page: version 42 Last edited on Thursday, August 3, 2006 9:51:33 pm by AristotlePagaltzis Revert
@@ -34,8 +34,12 @@
  
 <verbatim> 
 xset b 0 
 </verbatim> 
+  
+If you use gnome, then that annoying beeping can be disabled by going to System > Preferences > Sound  
+  
+Find the "System Beep" tab and uncheck "Enable System Beep".  
  
 !! How do I do arithmetic in bash? 
  
 Surround the expression with $(( )), eg: 
@@ -194,8 +198,19 @@
  
 <verbatim> 
 ROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"' 
 </verbatim> 
+  
+!!How do I enable case-insensitive tab completion?  
+  
+* bind "set completion-ignore-case on"  
+  
+That should configure the shell completion to be case-insensitive for  
+the remainder of the session.  
+  
+Make permanent:  
+Create a file called .inputrc in your home directory and put this line in it:  
+*set completion-ignore-case on  
  
 !! Help, bash is listing my files weird! 
  
 Well, bash is listing nothing. It's ls(1) and its locale support that matter here, it has nothing to do with the [Shell]. But this is where you'd expect to find this tidbit. 
@@ -344,11 +359,39 @@
 END_SCRIPT 
 </verbatim> 
  
 â€”AristotlePagaltzis 
+  
+!How can I see what my command will look like after bash expands it?  
+  
+After typing the command, press ''Esc'' then press ''C-e''  
+  
+  
+!How can I do Division in bash using floating point numbers?  
+  
+Use ''bc''  
+  
+*echo "scale=10;5/4" | bc"  
+  
+will result in : 1.2500000000  
+The value of the scale function is the number of digits after the decimal point in the expression. (In this case 10)  
+  
+!How Can I use ''and'' / ''or'' in bash if statements?  
+  
+  
+*You can do boolean OR in BASH by using the -o operator.  
+*You can do boolean AND in BASH by using the -a operator.  
+  
+Try intermixing the two also.  
+  
+<verbatim>  
+if [ $bla -eq 1 -o $cars -eq 3 -o $monkeys -eq 4 ]; then  
+ echo "Westside"  
+fi  
+</verbatim>  
  
 !! See also 
  
 * CommonErrors, under "Your shell hangs" 
 * BashOneLiners 
 * SpacesInPathNames 
 * PortabilityNotes