Recent Notes

Displaying keyword search results 1 - 7
Created by Dr. Xi on February 07, 2012 15:40:11    Last update: February 07, 2012 15:40:11
An alias defined in .profile does not work when you open a bash window from the desktop. Simply put, alias should be put in .bashrc ; PATH should be put in .profile . These are the facts: .profile is executed by the login shell, i.e., when you login. .bashrc is executed whenever a bash shell is opened - login or non-login. When you open a new bash window from the desktop, a non-login shell is created, it will execute .bashrc , not .profile . When you ssh to a remote system interactively, a login shell is created. When you ssh to a remote system and run a command directly, a non-login shell is created. PATH modifications should be put in .profile since it is usually...
Created by voodoo on December 08, 2011 14:32:06    Last update: December 08, 2011 14:32:06
Use the read command to pause a shell script and give the user a chance to stop it: #!/bin/sh echo "Press CTRL-C to stop this scrip...
Created by woolf on September 30, 2011 13:58:02    Last update: September 30, 2011 13:58:14
Use IO redirection to swap stdout and stderr : $ prog 3>&1 >&2 2>&3 3>&-
Created by freyo on September 15, 2011 16:23:14    Last update: September 21, 2011 13:06:00
These steps set up a PPP connection between an Android device and your Linux PC, so that the device can use the Internet connection of the PC. To share an Internet connection the other way around, reverse the roles of the PC and the device. Assuming the host will use IP address 192.168.0.1 and the device 192.168.0.2 : Prepare host for NAT and IP forwarding $ sudo sysctl net.ipv4.ip_forward=1 $ sudo ipta... The first rule is inserted at the beginning of the NAT table. The second and third rules are inserted into the second place in the rules chain. Start PPP with adb $ sudo adb ppp "shell:pppd nodetach noauth noipdef... Add DNS server to device (get dns server ip address from /etc/resolve.conf ): $ adb shell # setprop net.dns1 192.168.33.1 ...
Created by magnum on June 23, 2011 13:08:47    Last update: June 23, 2011 13:08:47
In Linux shell (bash & ksh), executing " set -m " turns on job control . This option is on by default for interactive shells . Background processes run in a separate process group and a line containing their exit status is printed upon their completion.
Created by magnum on May 06, 2011 12:28:06    Last update: May 06, 2011 12:28:06
These Xterm escape sequences change the window and icon titles: ESC]0;stringBEL : Set icon and window title to string . ESC]1;stringBEL : Set icon title to string . ESC]2;stringBEL : Set window title to string . where ESC is the escape character ( \033 ), and BEL is the bell character ( \007 ). Examples: # Change window title to 'Title' echo -e '\033]... Or, use PROMPT_COMMAND (for bash ) to set it up automatically: export PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007... Setting PROMPT_COMMAND may be the only way to change the title since it may have already been set when the shell started (in .bashrc for example). Doing echo will not help you in that case because PROMPT_COMMAND sets the title right back after you tried to change
Created by Dr. Xi on February 07, 2008 22:32:44    Last update: February 07, 2008 22:32:44
To get a list of valid login shells: cat /etc/shells To change your login shell to bash: chsh -s /bin/bash