Twitter Updates
G-AVLN in front of her home
Mostly Unix and Linux topics. But flying might get a mention too.
Sunday, November 19, 2006
The IFS mystery
But there is a side effect, which I have only discovered recently, by accident. If you assign positional parameters with set:
$ set a 'b c' d 'e f'
than using the * parameter we can get at the values individually or as one word. To illustrate, try the following:
$ echo $* "$*"
a b c d e f a b c d e f
However, if you 'nullify' the IFS variable:
$ IFS=""
then the behaviour of the shell when referencing the * parameter changes:
$ echo $* "$*"
a b c d e f ab cde f
This only works with the * parameter (not with @) and only if IFS had a null value (if you inset IFS altogether, then the shell will use a space to separate positional parameters.
Finally, I've checked this behaviour in ksh and bash - same (and documented in manual pages, at least in bash).
Wednesday, November 15, 2006
Quoting command substitution
When we learn the inner works of a shell, we quickly realise the benefit of using double quotes with request for variable substitution.
For example, to assign a value to a variable (and preserve leading spaces), we would use:
$ address=" 23 Acacia Avenue "
A correct quotation is needed to recall the value complete with the spaces:
The less known application of the quotes is when they are around the command substitution syntax. By default, POSIX shells remove trailing new-lines during command substitution. Double quotes change this behaviour!
Compare the output of the following commands:
$ echo $(ls)
log.1 log.2 log.3
and
$ echo "$(ls)"
log.1
log.2
log.3
Wednesday, November 08, 2006
Graphics problems...
Seems fine, until you try to restart the X Window System with CTL-ALT-Backspace. The screen just goes blank, no message, no GUI - nothing. Log into a character interface, run level 5 is shown, and the startx command works well.
Just wonder, actually... Could it be a setting somewhere stopping the CTL-ALT-Backspace restart deliberately? Will need to do a bit of 'googling'.
Tuesday, November 07, 2006
Adjusting the kernel for Oracle
On Linux, the process is much simpler, as most of the significant parameters may be changed 'on the fly', effortlessly, and without as much as a reboot, let alone kernel compilation.
All current kernel parameters may be found in /proc/sys/kernel location. Explore it, to see that each parameter has its own file, with either a Boolean Yes/No (or 1/0) or a string value.
The set of parameters required for Oracle10g (only part of the list is quoted here) says:
shmmax = 2147483648
shmmni = 4096
shmall = 2097152
shmmin = 1
shmseg = 10
There are different ways of implementing it: first of all, you can get the values directly into the memory constructs, for example:
# echo 2147483648 > /proc/sys/kernel/shmmax
This will adjust the value correctly, with the slight drawback - the value will return to whatever the default was after the next reboot.
Alternatively, for a more permanent modification, you can place the required definitions in the kernel configuration file: /etc/sysctl.conf.
kernel.shmmax=2147483648
kernel.smni=4096
kernel.shmall=2097152
kernel.shmin=1
kernel.shmseg=10
and inform the kernel of the changes with:
# sysctl -p
command, which will read the values from the sysctl.conf file and place them in the
appropriate files under /proc/sys/kernel.
Any subsequent reboots will also make use of these values.
Blog Archive
- October (1)
- June (1)
- April (2)
- February (3)
- June (1)
- March (1)
- August (3)
- July (2)
- June (1)
- March (1)
- June (3)
- May (1)
- April (5)
- February (1)
- January (5)
- October (1)
- September (3)
- July (4)
- June (5)
- April (3)
- March (1)
- February (3)
- January (3)
- October (7)
- August (2)
- July (3)
- May (1)
- November (4)
- October (1)
- September (1)
- August (2)
- July (2)
- June (3)
- May (3)
- April (2)
- March (2)
- February (3)
- January (1)
- December (2)
- November (1)
- October (6)
- September (6)
- August (1)
- July (2)
- June (8)
- May (3)
- April (4)
- March (3)