looks
in shell script. It is used like this-
myIpExec <<< "{IPaddr1} ${IPaddr2} ${IPaddr3} ${IPaddr4}"
Result=$?
--
Mike Stroyan
tabs, and newlines. Be sure to put IFS 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
sort -k 1.1,1.1
for c in {32..126}; do eval printf '"%c - %d\n"' $(printf "$'%o'" $c)
$c;done | LANG=C sort -k 1.1,1.1
The collation order lists 'a' before '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
1:busybox manual and check the details of
your device.
--
Mike Stroyan
u please
> tell me how to make a start?
Have a look at the readline library, which bash uses.
http://tiswww.case.edu/php/chet/readline/rltop.html
--
Mike Stroyan
will not appear when 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]>
7; -f5 | tr -d ,
> >
> > Any other suggestions?
You could use substring expansion 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:
.JPG,123456_47.JPG'
a=(www/images/*);a=$(IFS=,; echo "${a[*]}";);a="${a//www\/images\/}";echo $a
--
Mike Stroyan <[EMAIL PROTECTED]>
a wrapper application like kstart 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 fi
d
do
if [[ $int == $interface ]]
then
echo $rxcnt $txcnt
fi
done
}
It would be more modular to use an argument to get_data to pass
the interface instead of using the $interface global variable.
get_data()
{
local int d
on prevents pathname expansion.
$ echo $BASH_VERSION
3.2.25(1)-release
$ touch a b c.d e.f
$ ls
a b c.d e.f
$ a=111.1
$ echo ${a//[0-9]/*}
c.d e.f
$ echo "${a//[0-9]/*}"
***.*
$ a=111
$ echo ${a//[0-9]/*}
a b c.d e.f
$ echo "${a//[0-9]/*}"
***
$
--
Mike Stroyan <[EMAIL PROTECTED]>
hen run
r /testcase
to acutally use the recursive function on /testcase.
But the find command is very good at doing this as well.
find /testcase -name autotest.sh -perm /111 -execdir bash -c ./autotest.sh \;
--
Mike Stroyan <[EMAIL PROTECTED]>
uestion about directory tree walking.
--
Mike Stroyan <[EMAIL PROTECTED]>
a bit faster than using $(pwd) to execute the pwd builtin.
$ s=$SECONDS;for (( i=1;i<1;i++ )) ;do d=$(/bin/pwd);done;echo
$(($SECONDS-$s))
23
$ s=$SECONDS;for (( i=1;i<1;i++ )) ;do d=$(pwd);done;echo $(($SECONDS-$s))
8
$ s=$SECONDS;for (( i=1;i<1;i++ )) ;do d=$PWD;done;echo
o away.
You need to call setpgrp or setsid and then open a pty device
to establish the pty as a control terminal.
--
Mike Stroyan <[EMAIL PROTECTED]>
do I make it seperate 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]>
rectly on debian for some locales.
I get good output 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]>
eadline editing.
#!/bin/bash
history -r script_history
set -o vi
CMD=""
while true
do
echo "Type something"
read -e CMD
history -s "$CMD"
echo "You typed $CMD"
case "$CMD" in
stop)
break
;;
hi
bash 3.2.13(1) from
ubuntu 7.04. If a urxvt window is maximized or grows large enough to exceed
the screen size, 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 n
in "man bash"-
\[ begin a sequence of non-printing characters,
which could be used to embed a terminal control sequence into the
prompt
\] end a sequence of non-printing characters
--
Mike Stroyan
[EMAIL PROTECTED]
_
g.
Sparse core files can cause trouble for the unwary. They may become
non-sparse when copied. That takes up more disk space.
--
Mike Stroyan
[EMAIL PROTECTED]
___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash
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 othe
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 s
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?
l. It is an rlogin question.
Type ~. 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
art and end of the string. You
won't get a match
with
[[ "string" =~ "^[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 Stro
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]
___
ment.
COMMENT
It would be safer to quote a character 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
rray2_3"
$ set | grep pre_
_='pre_A_two[3]=array2_3'
pre_A_one=([1]="array1_1" [2]="array1_1")
pre_A_two=([1]="array2_1" [3]="array2_3")
pre_one=simple1
pre_two=simple2
$ i=1
$ eval "echo \${pr
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
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' -DPACKA
e for HPUX and timezone in the 3.1 version of that file.
Bash 3.1 builds fine for me on HP-UX 11.11.
--
Mike Stroyan
[EMAIL PROTECTED]
___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash
prompt problem 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 S
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' -DPACKA
+++ bash/parse.y2006-01-07 16:12:40.0 -0700
@@ -2906,8 +2906,8 @@
{
if (open == ch) /* undo previous increment */
count--;
- if (ch == '(')/* ) */
- nestret = parse_matched_pair (0, '(', ')'
35 matches
Mail list logo