prevent more regretful suspend

2007-06-18 Thread jidanni
Regarding suspend: suspend [-f] Suspend the execution of this shell until it receives a SIGCONT signal. The `-f' if specified says not to complain about this being a login shell if it is; just suspend anyway. My problem is often in an e.g., xterm window I suspend by accident,

TAB strips wildcards

2007-08-29 Thread jidanni
Here is a true case of what happens when you hit TAB with a wildcard: $ shar /tmp/logs/*/*/*TAB access.log access.log $ shar /tmp/logs/ Yes, it strips the wildcards!

Re: TAB strips wildcards

2007-08-29 Thread jidanni
EB Have you installed a completion function? # su - nobody No directory, logging in with HOME=/ [EMAIL PROTECTED]:/$ #WHATEVER /tmp/logs/*/*/*TAB access.log access.log [EMAIL PROTECTED]:/$ bind 'set show-all-if-ambiguous on' [EMAIL PROTECTED]:/$ #WHATEVER /tmp/logs/*/*/*TAB access.log

case/esac: mention backslash to match a leading (

2007-12-15 Thread jidanni
On the man page: case word in [ [(] pattern [ | pattern ] ... ) list ;; ] ... esac perhaps mention one needs a backslash to match a leading (: case '(1' in (1) echo 2;; \(1)echo 3;; esac

ESC . on # items

2007-12-17 Thread jidanni
$ echo abc abc $ #echo xyz $ Now do ESC . and experience the pain of the buzzer or visual bell that means one has done something bad. Yes, I know you are against thinking that one would ever want the last item of something one commented out, but at least you don't have to chastise them :-( I

Re: ESC . vs. ^R, ^P again

2008-01-07 Thread jidanni
C \M-.:\M-\M-_ Thanks but that doesn't work. $ : 1 $ : 2 $ : 3 $ : 4 $ I want now typing ^R 2 ^E M-. to put a 4 at the end of the line but the above macro does not.

Re: ESC . vs. ^R, ^P again

2008-01-07 Thread jidanni
$ bind '\e.:\e\e_' $ : 1 $ : 2 $ : 3 $ : 4 $ I want now typing ^R 2 ^E M-. to put a 4 at the end of the line... ...and not wipe out the 2, which is what the above bind did. BASH_VERSION='3.1.17(1)-release'

Re: Dr. Evil typed sleep 666; rm -rf /

2008-02-11 Thread jidanni
Your attention is drawn to the current thread, a small sample of which is: Newsgroups: comp.unix.shell Subject: Re: Dr. Evil typed sleep 666; rm -rf / Date: 11 Feb 2008 bash is the only shell that will run rm if you interrupt sleep with C-c. All the other shells including the Bourne shell,

set +o history hard to keep turned off

2008-02-23 Thread jidanni
Put set +o history at the bottom of .bashrc and confirm that it is indeed the last thing run via $ bash -x But then do $ set -o|grep history which will show that it is turned back on.

document export x=1 y=$x

2008-03-17 Thread jidanni
On the man page at section export, mention that the latter below will not do what one expects, as here revealed: $ set -x $ a=1 b=$a + a=1 + b=1 $ export x=1 y=$x + export x=1 y= + x=1 + y= Yes I'm sure it is mentioned elsewhere on the page but you might want to drum it home again here. Maybe also

TZ=... date affected PROMPT_COMMAND

2008-04-16 Thread jidanni
Never thought that putting TZ here would infect my prompt, 21:07 ~$ date Wed Apr 16 21:07:54 CST 2008 21:07 ~$ TZ=America/Chicago date Wed Apr 16 08:08:07 CDT 2008 08:08 ~$ set a b c 08:08 ~$ date Wed Apr 16 21:08:22 CST 2008 21:08 ~$ all the way until the next non built-in command. Need to do

Re: TZ=... date affected PROMPT_COMMAND

2008-04-17 Thread jidanni
OK, now using Archimerged's cleaner version, I bet Matthew can reproduce this. [EMAIL PROTECTED]:/root# su - nobody No directory, logging in with HOME=/ [EMAIL PROTECTED]:/$ PROMPT_COMMAND='prompt_status=\ $?' [EMAIL PROTECTED]:/$ PS1=$SPECIAL_PS1\A\${prompt_status# 0} \W$ 17:26 /$

Re: [Pkg-shadow-devel] Bug#476519: shell-mode garbles input

2008-05-01 Thread jidanni
As http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=476519 says, maybe it is a bash bug: with Debian sid's BASH_VERSION=3.2.33(1)-release about half the time the below works normally, the other half some magic hand sends exit to it, logging me out right away. The first letter of which gets bitten

Re: [Pkg-shadow-devel] Bug#476519: shell-mode garbles input

2008-05-02 Thread jidanni
SC Try SC sudo env -i SHELLOPTS=xtrace su -p - nobody (I don't use sudo) uid=0(root) gid=0(root) groups=0(root) # env -i SHELLOPTS=xtrace su -p - nobody + PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games + '[' /bin/sh ']' + PS1='[EMAIL PROTECTED]:\w\$ ' + export PATH + umask 022 [EMAIL

Re: [Pkg-shadow-devel] Bug#476519: shell-mode garbles input

2008-05-02 Thread jidanni
Here we see the typical deal. You asked me about ulimit. I tried to get a shell oh, six times this time before the magic hand stopped logging me out. Whereupon it bites off the first character of what I type and logs me out, saving the message for after the next prompt. Then I get a shell again to

Re: [Pkg-shadow-devel] Bug#476519: shell-mode garbles input

2008-05-02 Thread jidanni
CR Does this happen only in an emacs shell-mode window? No. It happens also in xterm. Today it at least allowed me to do -c date. I did not type exit or logout. The magic hand did. # su - nobody -c date No directory, logging in with HOME=/ Sat May 3 01:03:10 CST 2008 # su - nobody -c 'sh -i' No

distinguish shell generated exits

2008-05-02 Thread jidanni
There are several situations where $ exit and $ logout were typed by the shell and not the user, who must specifically say I did not type that, some magic hand did when sharing shell transcripts with other people. So perhaps those messages should have a bash: prepended or something to distinguish

Re: [Pkg-shadow-devel] Bug#476519: shell-mode garbles input

2008-05-03 Thread jidanni
SC Could you try ulimit -a? # su - nobody -c ulimit\ -a|grep -v unlimited core file size (blocks, -c) 0 scheduling priority (-e) 0 pending signals (-i) 1791 max locked memory (kbytes, -l) 32 open files (-n) 1024 pipe size

Re: [Pkg-shadow-devel] Bug#476519: shell-mode garbles input

2008-05-05 Thread jidanni
All I have installed else is dash: 4 successes 0 failures. SC perl -e '$=$=$(=$)=65534; exec sh' That gets a shell without triggering the error. SC perl -e '$=$=$(=$)=65534; system sh' That filled emacs with \377's with luckily a little CPU left over that I could kill emacs... * SC Not sure how

Re: what matched in a case statement

2008-05-14 Thread jidanni
Poor Yorick wrote: Is there any way to get a handle on what matched in a case statement? Something like this: case lawlesspoets in *poets) echo $CASEMATCH one Well, nobody would do case lawlesspoets in in reality you would always have some variable. So just do

Re: Dr. Evil typed sleep 666; rm -rf /

2008-06-15 Thread jidanni
The following message is a courtesy copy of an article that has been posted to comp.unix.shell as well. Regarding how to defuse $ sleep 666; echo BOOM given only one terminal, m Here, running bash in a xterm, this works for me: m ^S ^C ^C ^Q For me in xterm, or even on the Debian sid tty1

test -t

2008-09-03 Thread jidanni
On (info (coreutils)File type tests, and test(1) man page, we see `-t FD' True if FD is a file descriptor that is associated with a terminal. Well please mention what happens if FD is omitted: $ test -t The answer is it always returns true, no matter what. Test with $ echo 'set -x; for i

Re: test -t

2008-09-03 Thread jidanni
Is this a bug? $ t=test #bash builtin $ $t -t ' '; echo $? 0 PJ That looks like a bug. bash tries to parse a number from the PJ string and ends up with zero, which is a tty.

script vs. terminal vs. same line vs. ^C

2008-09-09 Thread jidanni
Here we see with the same $-, if you put it on the same line, you'll run it despite ^C... $ cat file echo $-; sleep 7; echo BOOM $ bash -i file bhimBC ^C $ echo $-; sleep 7; echo BOOM bhimBC ^C BOOM OK, same $-, and same test -t whatever, so what does one have to do to make bash think it is a

C-z bg without the lurch

2008-11-25 Thread jidanni
There are many times one has not planned ahead, and forgets the : $ emacs -nw important.txt #then after a half an hour of editing: ^Z [1]+ Stopped emacs -nw important.txt $ compact_disk_burner_GUI_application #forgot to add OK, we want to get back to emacs, but we dare not stop

document -u $@ $* special case

2008-11-26 Thread jidanni
Gentlemen, I have discovered a documentation oversight. In the manual, we see: -u Treat unset variables as an error when performing param- eter expansion. If expansion is attempted on an unset variable, the shell prints an error

echo $s{2,3}

2008-12-13 Thread jidanni
What happened to 2,3? Poof, gone. $ s=a; echo $s{ $s{} $s} $s{1} $s{2,3} ${s}{4,5} a{ a{} a} a{1} a4 a5

NULL patch

2008-12-16 Thread jidanni
*** bash.1.orig 2008-12-17 07:41:13.193756000 +0800 --- bash.1 2008-12-17 07:39:39.845759000 +0800 *** *** 3157,3159 current source until a line containing only ! .I word (with no trailing blanks) --- 3157,3159 current source until a line containing only ! .I

Re: NULL patch

2008-12-17 Thread jidanni
j + If \fIdelimiter\fP is not found or \fIword\fP is null, reading proceeds to the end of file. Make that just If \fIdelimiter\fP is not found, reading proceeds to the end of file. I can't reproduce the other today without getting an error.

I really mean to go to EOF

2009-03-19 Thread jidanni
You know those pesky error messages, nurdsome: line 17: warning: here-document at line 1 delimited by end-of-file (wanted `EOF') Well there should be a new 'trick': $EOF, \$EOF, or something, the meaning of which is 'I really mean to go all the way to the end of the file'. This is in addition

arithmetic + + subshell might not be documented

2009-04-01 Thread jidanni
Might not be documented: $ cat q for i in : :; do :|: x$((++a)); echo =$a=; done; ls x?; rm x? for i in : :; do :x$((++b)); echo =$b=; done; ls x?; rm x? $ bash q == == x1 =1= =2= x1 x2

set -x prejudiced; won't smell UTF-8 coffee

2009-04-06 Thread jidanni
Gentlemen, -x's reporting should just pass the Chinese right back. $ set -x; export LC_ALL=$LANG; echo 中文 + export LC_ALL=zh_TW.UTF-8 + LC_ALL=zh_TW.UTF-8 + echo $'\344\270\255\346\226\207' 中文 Or OK, to be fair, even the ASCII should come back as octal escapes.

Re: set -x prejudiced; won't smell UTF-8 coffee

2009-04-06 Thread jidanni
Mike Frysinger vap...@gentoo.org writes: exactly do you suggest differentiating... I don't know. It's all truly over my head. All I know is how are you going to 'market' this stuff in Asia?. I mean the US kids get to see all their -x feedback pretty, but Asians must see it garbled. I don't know.

Re: set -x prejudiced; won't smell UTF-8 coffee

2009-04-08 Thread jidanni
Instead of having bash make judgements about what people want from their personal mix of: $ locale|sed 's/.*=//;s///g;/^$/d'|sort|uniq -c 2 C 11 zh_TW.UTF-8 instead just have a passthru option they could enable, that says I hereby agree that I want to be sent raw -x output back, and if

Re: set -x prejudiced; won't smell UTF-8 coffee

2009-04-08 Thread jidanni
locale variables have pretty clear definitions. obviously LC_COLLATE wouldnt be relevant here, but LC_MESSAGES certainly would. Assumptions, assumptions, those happen to be the two C's for me. So let me override without having to tamper with them please.

Re: set -x prejudiced; won't smell UTF-8 coffee

2009-04-08 Thread jidanni
Mike Frysinger vap...@gentoo.org writes: i never said you couldnt override them. i said the *default behavior* would OK, it's a deal. Now all that's left is for that Chet guy to implement it :-)

mention what characters need to be escaped inside [...]

2009-05-03 Thread jidanni
Maybe mention in the man page at [...] Matches any one of the enclosed characters... that one will need to backslash at least any spaces used inside it: $ ls [^ ] ls: cannot access [^: No such file or directory ls: cannot access ]: No such file or directory $ ls [^\ ] a

Re: mention what characters need to be escaped inside [...]

2009-05-04 Thread jidanni
Greg Wooledge wool...@eeg.ccf.org writes: quotes inside -- [^ ] -- works. But the backslash approach you used is probably the clearest way to write it. Anyways, it should be mentioned in the man page's [...] discussion, even though legally one could say it is probably already mentioned, though

M-. rings bell if empty

2009-06-08 Thread jidanni
Type # RET ESC . Bash replies with a ^G Wouldn't it be more polite to just do nothing, instead of waking up the neighbors? $ expr 2 + 2 4 $ #e=mcHammer -here I typed ESC # $ e=mc-here I type ESC . ESC . in order to get the 2, but after the first ESC . I must endure the ^G slap in the

showing expansion bifurcation point better

2009-06-09 Thread jidanni
When showing choices, $ ls /cf/124451TAB 1244516986.31615_0.ps11007 1244517019.1029_0.ps11007 maybe indicate the bifurcation point with termcap bold, like emacs, or with a pipe: 124451|6986.31615_0.ps11007 124451|7019.1029_0.ps11007 or just show the remaining part, like ...6986.31615_0.ps11007

line up completions vertically

2009-07-25 Thread jidanni
You know how it shows us the choices when we hit TAB, # rm /var/tmp/dan_home_bkp2009-07-26-02-TAB dan_home_bkp2009-07-26-02-18-36.bz2 dan_home_bkp2009-07-26-02-27-07.bz2 Well given that we are not going to bother to make the differing endings bold, like in emacs, well, at least we can line them

history --no-numbers-please

2009-08-06 Thread jidanni
$ history needs a --no-numbers-please option (-u maybe?), as I can't recall when I didn't run the output through sed to get rid of them.

Re: history --no-numbers-please

2009-08-07 Thread jidanni
CR == Chet Ramey chet.ra...@case.edu writes: $ history needs a --no-numbers-please option (-u maybe?), as I can't recall when I didn't run the output through sed to get rid of them. CR Why not just use fc -ln? Because help history didn't tip me off that I could try that. However $ history|wc

cd $x; rmdir $x; mkdir $x; ...

2009-09-11 Thread jidanni
: cannot access parent directories: No such file or directory $ exit $ ls . $ ls -l total 0 $ ls -la total 0 $ ls -la . total 0 $ ls -la $PWD total 0 drwxr-xr-x 2 jidanni jidanni 60 2009-09-12 01:55 . drwxrwxrwt 9 rootroot440 2009-09-12 01:55 .. -rw-r--r-- 1 jidanni jidanni 0 2009-09-12 01:55 k

Re: ESC SPC please

2009-11-28 Thread jidanni
PG maybe try the following macro: PG bind '\M- :\M-\\ ' Sorry, that doesn't work on the command line or .inputrc. No effect.

want a M-. that ignores C-r

2009-12-18 Thread jidanni
Same question for years: Want some way for M-. to get the last item, regardless of if we are here via a C-r or not. I want some dumber-downed version of M-., however at the same time I don't want to use that cshell ! stuff. I want something I can bind to M-.. Thanks.

have bg, fg, but lack stop

2009-12-19 Thread jidanni
Notice how I need two steps to stop this running job: $ jobs [1]+ Running firefox $ fg firefox ^Z [1]+ Stopped firefox As there is no $ stop %1 like command. OK, I suppose I can use $ kill -s SIGSTOP %1 $ [1]+ Stopped firefox OK, never mind.

are you sure you want to add all the ! stuff to the history?

2010-04-05 Thread jidanni
Are you sure you want to add all the ! stuff to the history? $ mail root ! (then I pasted a big blob here) ! $ To my surprise ^P showed the big blob too. (I didn't just use $ mail root because then it would ask me Cc:, Subject:)

allow printing completions vertically

2010-04-10 Thread jidanni
We read print-completions-horizontally (Off) If set to On, readline will display completions with matches sorted horizontally in alphabetical order, rather than down the screen. Maybe the above variable is mainly talking about sorting order, in

mention bind commands too

2010-04-10 Thread jidanni
On man bash _kindly_ mention there is indeed a way to use the following, with no further ado, by adding the stuff in parentheses: dump-functions (bind -P) Print all... dump-variables (bind -V) Print all... dump-macros (bind -S) Print

match-hidden-files docstring

2010-04-10 Thread jidanni
We read match-hidden-files (On) This variable, when set to On, causes readline to match files whose names begin with a `.' (hidden files) when performing filename completion, unless the leading `.' is supplied by the user in

~/.inputrc syntax errors not reported to the user

2010-04-10 Thread jidanni
In ~/.inputrc I put the following syntax error sdsddd sdsds and save the file and run re-read-init-file (C-x C-r). No error is reported to me.

completion gobbles partial match string

2010-05-01 Thread jidanni
Put the cursor after the word list and hit TAB: # find /etc/apt/sources.list.d/*list #|cpio -o|ssh 192.168.44.4 cpio -ivdm Emacssources.list eeepc.list tw.list # find /etc/apt/sources.list.d/ #|cpio -o|ssh 192.168.44.4 cpio -ivdm Notice how we are shown the completions, but then the

Re: completion gobbles partial match string

2010-05-01 Thread jidanni
CR == Chet Ramey chet.ra...@case.edu writes: CR I have to assume that you're using programmable completion, CR and the compspec for `find' doesn't impose the same restriction. Same happens with cat or :, not only find. It doesn't happen for # su - nobody And I've isolated the problem to somewhere

Re: completion gobbles partial match string

2010-05-05 Thread jidanni
CR Should readline do this only if there are multiple matches? Getting over my head... I'll trust your judgment.

^K should go to next history item

2010-05-10 Thread jidanni
^P^P^P^P^K^K^K^K or at least ^P^P^P^P^A^K^A^K^A^K^A^K should kill each line out of the history. Instead we need to do more steps: ^P^P^P^P^A^K^N^A^K^N^A^K^N^A^K .

[Qq] vs TAB

2010-06-04 Thread jidanni
BASH_VERSION='4.1.5(1)-release' $ ls /cf/20100428xindianS* /cf/20100428xindianSQUARE.jpg /cf/20100428xindianSquare2.jpg $ xli /cf/20100428xindianS[Qq]TAB #shows nothing. Wrong. $ xli /cf/20100428xindianS[Qq]*TAB #shows the files, but then eats the [Qq]* 20100428xindianSQUARE.jpg

document $MAIL for Maildir users

2010-07-21 Thread jidanni
man page says MAIL If this parameter is set to a file name and the MAILPATH variable is not set, bash informs the user of the arrival of mail in the specified file. OK, but also mention one can set it to a directory. And say that MAIL=$HOME/Maildir/ is what Maildir

quotes invade positional parameters

2010-12-18 Thread jidanni
WITNESS for yourselves as the quotes invade the parameters, absconding with the ones at the edges, when close enough. $ cat 201012contract #!/bin/sh -eux set a b c d e f : ''$@'' : ' '$@' ' : ''$*'' : '' $* '' : $* $ ./201012contract + set a b c d e f + : a b c d e f + : '

Re: quotes invade positional parameters

2010-12-18 Thread jidanni
JS == Jan Schampera jan.schamp...@web.de writes: JS I'd say this is expected (and by the way it's not only on set -x). I see. The spaces indeed get glued to the sides. OK, see ya next time.

Re: quotes invade positional parameters

2010-12-18 Thread jidanni
Well anyway, it would be 'no skin off of bash's back' if it just reported what it was given. If it was given ' 'a b c it should report ' 'a b c and not just 'assume' we prefer ' a' b c or ' a' 'b' 'c' etc. Just as legitimate and doesn't cause calls in the middle of the night from the old

Re: quotes invade positional parameters

2010-12-22 Thread jidanni
Indeed, it is more compact to report ' a' than \ \ \ \ \ \ \ \ \ \ a OK OK... see you next bug.

backslash required for [\/]

2010-12-25 Thread jidanni
I have discovered yet another bug in your bash program. First we see how a normal program, trusty sed, deals with [ ]: $ r=abaab; echo $r|sed 's/[:?/ba]/u/g' u Now we try bash: $ r=abaab; echo ${r//[:?/ba]/u} abaab $ r=abaab; echo ${r//[:?\/ba]/u}

reveal matched chars before asking Display all possibilities, not after

2011-01-13 Thread jidanni
Here only after I say 'n' is it revealed to me that I have already completed /func, not just /fu: $ w3m /usr/share/doc/php-doc/html/fuTAB Display all 5361 possibilities? (y or n) n $ w3m /usr/share/doc/php-doc/html/func Therefore, please make bash, upon receiving a TAB, first add all the

set -m +m -x and the element of chance or is it race conditions?

2011-01-23 Thread jidanni
Gentlemen, I am disturbed by these seemingly irregular results, # perl -pwle 's/\d{4}//' mm|sort|uniq -c 88 ++ kill 44 ++ set +m 44 ++ set -m 1 ++ sleep 33 2 ++ sleep 66 1 ./rt: line 12: Terminated sleep 33 1 ./rt: line 12:

Re: set -m +m -x and the element of chance or is it race conditions?

2011-01-24 Thread jidanni
Thanks Greg, but aren't I acting by the rules? $ cat l set +m sleep 44 kill $! $ for i in `seq 33`; do bash -xm l; done Which gives + kill 5256 + set +m + kill 5258 + set +m + kill 5260 l: line 4: 5260 Terminated sleep 44 + set +m + kill 5262 + set +m + kill 5264 + set +m I.e., one

Re: set -m +m -x and the element of chance or is it race conditions?

2011-01-24 Thread jidanni
GW == Greg Wooledge wool...@eeg.ccf.org writes: GW You used seq, so you're clearly doing it on Linux. Maybe it's an GW OS-specific thing? Package: bash Version: 4.1-3 Debian Release: 6.0 APT prefers unstable APT policy: (500, 'unstable'), (1, 'experimental') Architecture: i386 (i686) Kernel:

Re: set -m +m -x and the element of chance or is it race conditions?

2011-01-28 Thread jidanni
I isolated the problem and submitted http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=611417 which I forget to X-Debbugs-cc to bash-...@gnu.org, which I should have, as it probably is a upstream problem that only the bash authors can fix.

Re: set -m +m -x and the element of chance or is it race conditions?

2011-01-29 Thread jidanni
CR == Chet Ramey chet.ra...@case.edu writes: CR Is it a problem? Bash prints messages about signal-terminated processes -- CR at least those that don't die due to SIGINT or SIGPIPE -- when the CR shell is not interactive. Most people want to know when their jobs die CR and their scripts fail.

Re: set -m +m -x and the element of chance or is it race conditions?

2011-01-29 Thread jidanni
Don't forget to mention that there better be e.g., at least a sleep 0 after it, if they want to be sure to see the message.

Re: set -m +m -x and the element of chance or is it race conditions?

2011-01-29 Thread jidanni
CR == Chet Ramey chet.ra...@case.edu writes: CR Is everything you don't like that's not explicitly documented a bug? In CR any case, a little thought should tell you why having the shell stick CR around long enough to catch the child's death makes a difference. With me you can exclude the

document factors influencing select's number of columns

2011-02-22 Thread jidanni
The 'select' documentation should also document the perhaps complex way $LINES $COLUMNS the number of items the length of the longest item interact to determine if the items will be displayed in rows/columns, etc.

TAB vs. colon

2011-12-30 Thread jidanni
The user pastes this into his shell window and adds uTAB $ ls /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/PNP0C0A:00/power_supply/BAT0/uTAB Any point in making him painfully go back and put backslashes behind each colon before expansion works (giving .../BAT0/uevent)?

Re: TAB vs. colon

2011-12-30 Thread jidanni
JS == Jon Seymour jon.seym...@gmail.com writes: JS You mean apart from the obvious that perhaps the user's intent was to JS paste unescaped colons into the command line at that point? In any JS case, paste is a function of the terminal, not the shell. I'm saying normally when we build a path, we

Re: TAB vs. colon

2011-12-30 Thread jidanni
GH == Geir Hauge geir.ha...@gmail.com writes: GH A workaround would be to quote the path. E.g. instead of GH ls pasteutab GH do GH ls 'paste'utab KoOl! It's a deal and I withdraw my case. Let's just hope this tip is documented.

let's set the positional parameters with a simple 'read'

2012-01-03 Thread jidanni
One can do $ read p to set $p but no just as easy method to set $@, $1, etc. One must do $ set -- `cat` #which involves ^D, too much trouble Or set -- `read x; echo $x` etc. No, nothing as easy as $ read 1 sds bash: read: `1': not a valid identifier $ read @ sdss bash: read: `@': not a valid

Re: let's set the positional parameters with a simple 'read'

2012-01-03 Thread jidanni
GW == Greg Wooledge wool...@eeg.ccf.org writes: GW Why not just use a named array? GW $ read -a myarray But does that let me get a my favorite array, the positional parameters?

Re: let's set the positional parameters with a simple 'read'

2012-01-03 Thread jidanni
Hmmm, as S. CHAZELAS said seems zsh also gives one a chance to reset an arbitrary positional parameter, e.g., the 42nd, whereas in bash one must set them all at once: $ set `seq 55` $ echo $42 42 $ echo $66 66 :-) Anyway isn't it rather old fashioned not to be able to somehow reset ${42} without

protection against accidental massive pastes into the command line

2012-04-26 Thread jidanni
Maybe there should be a limit, MAX_INTERACTIVE_COMMAND_LENGTH on how much can be fed into one bash command line, any more and bash should beep and reject the whole command. Otherwise an innocent middle click, or SHIFT INSERT slip of the fingers could paste an entire book out of the clipboard,

Re: protection against accidental massive pastes into the command line

2012-04-26 Thread jidanni
This would also save on later having to clean the massive blob out of the history list.

error messages should spit back out UTF-8

2012-05-06 Thread jidanni
$ LC_ALL=zh_TW.UTF-8 $ 哼 bash: $'\345\223\274':命令找不到 It really should spit out what it was given, not octal.

Display all 224 possibilities? (y,n,t,?,...)

2012-07-01 Thread jidanni
Dudes! I've got a brilliant idea. Instead of just saying Display all 224 possibilities? (y or n) Why not also offer more, like (y,n,t,?) Add t where t is by time as in 'ls -t', and ? is to explain them all. While you are at it, why not add even more, all from ls. l = ls -l etc. And

Why does -v not work until after } in scripts?

2012-07-30 Thread jidanni
Why does -v not work until after } in this script? # su - nobody No directory, logging in with HOME=/ $ cat /tmp/o { set -v # NO STDERR } # YES STDERR $ sh /tmp/o # YES STDERR bash: Installed: 4.2-4

Re: Why does -v not work until after } in scripts?

2012-07-30 Thread jidanni
Well -x works right away, but -v gets stuck until all depths of nested { } are over with.

variables vs. TAB

2012-08-15 Thread jidanni
$ mkdir /tmp/some_dir $ touch /tmp/some_dir/file $ a=/tmp $ cat $a/someTAB /tmp/someTAB Note how the former TAB just gives $a/some_dirSPACEBUG! Which SPACE one must replace with a / by hand to continue expanding like the latter. Whilst the latter gives /tmp/some_dir/ correctly.

don't just seek to the next line if the script has been edited

2013-06-07 Thread jidanni
Let's say you are running a script that is doing a loop while ... echo Enter name; read name; .. During which the script gets edited on the disk by somebody. Well shouldn't bash, when it goes back to the disk to read some next part of the script, first do some sort of check to tell if the script

Re: don't just seek to the next line if the script has been edited

2013-06-07 Thread jidanni
Well OK but sometimes a script could be running for years, during which any change to a file will result in bash executing random bytes... Imagine if you press down on the mouse button meanwhile someone moves the screen up or down... you end up pressing on a different person's face. So I don't

Re: don't just seek to the next line if the script has been edited

2013-06-07 Thread jidanni
GW == Greg Wooledge wool...@eeg.ccf.org writes: GW On Fri, Jun 07, 2013 at 09:09:53PM +0800, jida...@jidanni.org wrote: Well OK but sometimes a script could be running for years, during which any change to a file will result in bash executing random bytes... GW This is why you don't edit an

Re: don't just seek to the next line if the script has been edited

2013-06-07 Thread jidanni
CR == Chet Ramey chet.ra...@case.edu writes: CR I think the correct solution is to retain this behavior where it is CR required (e.g., when reading a script from the standard input) and to CR discard it when reading a script from a file. This doesn't directly CR address the jidanni's concern,

noclobber vs command not found

2013-06-08 Thread jidanni
Hello noclobber fans. It was a cheery day, until during an aptitude safe-upgrade, Processing triggers for hicolor-icon-theme ... (gtk-update-icon-cache:13613): GdkPixbuf-WARNING **: Cannot open pixbuf loader module file '/usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache':

Re: noclobber vs command not found

2013-06-10 Thread jidanni
GW == Greg Wooledge wool...@eeg.ccf.org writes: GW I find tab completion to be a primary safeguard Yes but in this case I am merely obediently copying the whole line with my mouse and stuffing it into the shell. Thanks anyway though.

can't just hold down ^K to clean up history

2013-10-16 Thread jidanni
Let's say one accidentally pastes a many lines of some email into a bash window. Yes bash tries to execute each line. Can't blame it. But now we are faced with cleaning the mess out of history. We use ^P^P^P^P^P^P^P... to finally get to the top of the mess. Then we must use

Re: can't just hold down ^K to clean up history

2013-10-16 Thread jidanni
Also why can't we just hold down ^K^K^K^K^K^K^K^K^K ? CD Why do you expect to be able to do that? C-k in readline deletes to the end of CD the current line. There's no reason why it should also get the next line. Ah ha, but there is also no reason why it should not! I hereby propose that it

Re: can't just hold down ^K to clean up history

2013-10-17 Thread jidanni
On Thu, Oct 17, 2013 at 07:54:47AM -0400, Chet Ramey wrote: It's the difference between a line-oriented command editing tool and a screen editor. Well, it could go that extra mile, as a extra bonus, since it is usually doing nothing better (well most commands are all on one line), to let us

let's establish BASH_MINIMUM_TIME_BETWEEN_INTERACTIVE_COMMAND

2014-01-29 Thread jidanni
Gentlemen, I have once again come up with a million dollar idea for bash, revolutionizing the shell world. As we all know, nobody in their right mind could type more than one command per second into bash when in interactive mode. So let's establish

bash should consult .config/bash/...

2023-12-09 Thread jidanni
Maybe on the list of config files bash looks at, there should be also .config/bash/... as that is the trend these days...