Re: Passing variables to and from custom programs

2010-02-07 Thread Mike Stroyan
} ${IPaddr4} Result=$? -- Mike Stroyan

Re: filename pattern case-insensitive, but why?

2009-09-23 Thread Mike Stroyan
'A', but actually lets a later character break a tie between otherwise equal uppercase and lowercase characters. Sort will arrange 'a1', 'A1', 'a2', and 'A2' with the '1' vs. '2' characters acting as a tiebreaker. -- Mike Stroyan

Re: string format

2009-09-23 Thread Mike Stroyan
back to the default for the benefit of later parts of your shell script that expect the default. You can do that with another assignment or with a subshell like this- ( IFS= ; printf \t%s\n $MyVar ) -- Mike Stroyan

Re: Inconsistent output in terminal emulator

2009-08-24 Thread Mike Stroyan
the details of your device. -- Mike Stroyan

Re: Need info on input keys

2009-08-02 Thread Mike Stroyan
tell me how to make a start? Have a look at the readline library, which bash uses. -- Mike Stroyan

Re: Missing .bash_history Entries

2008-05-24 Thread Mike Stroyan
cycling through commands using the arrow keys. That is a documented feature. It only ignores lines starting with space if HISTCONTROL is set to a value including ignorespace or ignoreboth. -- Mike Stroyan [EMAIL PROTECTED]

Re: finding the index at which two strings differ

2008-05-06 Thread Mike Stroyan
to compare characters one by one. #!/bin/bash a=$1 b=$2 if [[ $a == $b ]] then echo '$a' and '$b' are the same else i=0 while [[ ${a:$i:1} == ${b:$i:1} ]] do let i++ done let i++ echo '$a' and '$b' differ in character $i fi -- Mike Stroyan [EMAIL PROTECTED]

Re: converting an array into a single variable

2008-02-20 Thread Mike Stroyan
\/images\/};echo $a -- Mike Stroyan [EMAIL PROTECTED]

Re: Launching Apps to different desktops

2008-02-07 Thread Mike Stroyan
or devilspie to set the property on the window after it starts to map. That is likely to cause a visible flash as the application starts in the current workspace before it is moved to the requested workspace. I expect you would need to add one of those rather than finding one in RHEL4. -- Mike Stroyan

Re: Please advise on bash programming tactics/strategy

2007-12-13 Thread Mike Stroyan
txcnt d do if [[ $int == $target ]] then echo $rxcnt $txcnt fi done } Then you would invoke it as netdata=$(get_data $interface) -- Mike Stroyan [EMAIL PROTECTED]

Re: Problem with pattern replacing when STRING is an expandable char

2007-12-12 Thread Mike Stroyan
]/*} ***.* $ a=111 $ echo ${a//[0-9]/*} a b c.d e.f $ echo ${a//[0-9]/*} *** $ -- Mike Stroyan [EMAIL PROTECTED]

Re: SIGTTOU handling

2007-11-13 Thread Mike Stroyan
to call setpgrp or setsid and then open a pty device to establish the pty as a control terminal. -- Mike Stroyan [EMAIL PROTECTED]

Re: how could I execute a set of script in a directoy tree?

2007-11-13 Thread Mike Stroyan
the recursive function on /testcase. But the find command is very good at doing this as well. find /testcase -name -perm /111 -execdir bash -c ./ \; -- Mike Stroyan [EMAIL PROTECTED]

Re: Looping through lines with tabs of file with cat

2007-11-04 Thread Mike Stroyan
items by newline only? -- CODE -- fileIn=blah for i in $(cat $fileIn) do echo $i echo done Don't use cat. Read the contents of the file directly with read. fileIn=blah while read i do echo $i echo done $fileIn -- Mike Stroyan [EMAIL PROTECTED]

Re: What does the ` Characteter Do?

2007-10-08 Thread Mike Stroyan
with LANG=C man bash The problem comes from formatting of ` to an abstract 'left quote' value. That can be avoided by quoting it in the manual source as \`. That is an understandable error. Even man groff gets that wrong. -- Mike Stroyan [EMAIL PROTECTED]

Re: Readline history and bash's read -e

2007-09-02 Thread Mike Stroyan
= while true do echo Type something read -e CMD history -s $CMD echo You typed $CMD case $CMD in stop) break ;; history) history ;; esac done history -w script_history echo stopping -- Mike Stroyan [EMAIL

Re: recalculate LINES and COLUMNS

2007-08-22 Thread Mike Stroyan
, then the number of columns changes and $COLUMNS is updated immediately without using any kill command. (If the window is not maximized and remains small enough fit the screen then the number of lines and columns is not changed by the font change escape sequence.) -- Mike Stroyan [EMAIL PROTECTED]

Re: need explanation ulimit -c for limiting core dumps

2006-10-20 Thread Mike Stroyan
. They may become non-sparse when copied. That takes up more disk space. -- Mike Stroyan [EMAIL PROTECTED] ___ Bug-bash mailing list

Does HIGH_FD_MAX have to be so low?

2006-10-19 Thread Mike Stroyan
file descriptor value was 1023, which would have stayed out of the way of the application's use. Does HIGH_FD_MAX need to be so low? (OK. 255 isn't _REALLY_ low.) Are there negative consequences for using a higher file descriptor when getdtablesize() reports that they are allowed? -- Mike

Re: Does HIGH_FD_MAX have to be so low?

2006-10-19 Thread Mike Stroyan
On Thu, Oct 19, 2006 at 03:33:37PM -0400, Chet Ramey wrote: Mike Stroyan wrote: Looking at open_shell_script() in shell.c and move_to_high_fd() in general.c, I find that the code will force the use of fildes 255, (HIGH_FD_MAX), for reading the shell script when getdtablesize() reports

Re: Does HIGH_FD_MAX have to be so low?

2006-10-19 Thread Mike Stroyan
On Thu, Oct 19, 2006 at 04:02:36PM -0400, Chet Ramey wrote: Mike Stroyan wrote: move_to_high_fd() only avoid open file descriptors if the check_new parameter is non-zero. open_shell_script() calls move_to_high_fd() with a check_new value of 0. The other two callers of the function

Re: logout from interactive subshell

2006-10-12 Thread Mike Stroyan
~. to make rlogin to close the connection. The shells will all exit in response to that. (And you can do the same with ssh, which you should be using instead of rlogin.) -- Mike Stroyan [EMAIL PROTECTED] ___ Bug-bash mailing list http

Re: How to use [[ string =~ regexp ]]?

2006-05-21 Thread Mike Stroyan
=~ ^[a-z]$ ]] echo match But you will get a match with [[ string =~ ^[a-z]{6}$ ]] echo match because it matches the correct number of characters. -- Mike Stroyan [EMAIL PROTECTED] ___ Bug-bash mailing list

Re: unwanted expansion of variable with nested strings

2006-05-04 Thread Mike Stroyan
A little more bash syntax can quote newlines for awk. $ foo=a b c $ lf= $ gawk 'BEGIN {foo='${foo//$lf/\\n}'} END {print foo}' /dev/null a b c -- Mike Stroyan [EMAIL PROTECTED] ___ Bug-bash mailing list

Re: comment

2006-04-09 Thread Mike Stroyan
in the here document delimiter as I did above. That will prevent command expansion of the comment text which might have unintended side-effects. -- Mike Stroyan [EMAIL PROTECTED] ___ Bug-bash mailing list

Re: Using variables in variables names

2006-03-13 Thread Mike Stroyan
$ eval echo \${pre_A_${suffix}[$i]} array2_1 $ i=3 $ eval echo \${pre_A_${suffix}[$i]} array2_3 $ i=2 $ suffix=one $ eval echo \${pre_A_${suffix}[$i]} array1_2 -- Mike Stroyan [EMAIL PROTECTED] ___ Bug-bash mailing list http

edit-and-execute-command in non-posix vi editing mode fails with default editor

2006-03-10 Thread Mike Stroyan
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale'

Re: edit-and-execute-command in non-posix vi editing mode fails with default editor

2006-03-10 Thread Mike Stroyan
On Fri, Mar 10, 2006 at 04:40:00PM -0500, Chet Ramey wrote: Mike Stroyan wrote: ... Remove an extra right parenthesis from bashline.c. --- bash/bashline.c~2006-01-31 13:30:34.0 -0700 +++ bash/bashline.c 2006-03-09 12:32:24.0 -0700 @@ -800,7 +800,7

Re: bash-3.0.16 fails to compile on HP-UX 11.11

2006-02-25 Thread Mike Stroyan
builds fine for me on HP-UX 11.11. -- Mike Stroyan [EMAIL PROTECTED] ___ Bug-bash mailing list

Re: prompt with \[ \] corrupted by vi history search

2006-02-08 Thread Mike Stroyan
does occur with the non-incremental-reverse-search-history (M-p) feature in emacs mode. The patch corrects that symptom as well. I don't see any problem with the incremental search. It doesn't seem to ever try to incorporate the standard prompt. -- Mike Stroyan, [EMAIL PROTECTED