Re: bugs in trap signal handling
Chet Ramey wrote: > > On 10/10/12 2:53 AM, lanshun zhou wrote: >> Red Hat Enterprise Linux Server release 6.2 (Santiago) >> uname -r: 2.6.32-220.17.1.el6.x86_64 >> bash version: bash-4.1.2-9.el6_2.src.rpm (also tested with bash-4.2 >> compiled from source >> with patches bash42-001~bash42-037) >> >> When interrupt_immediately is set, handler for signals registered by trap >> is called >> immediately after the signal is triggered. But many function calls in >> trap_handler >> are not async-signal-safe, so it's unsafe and could cause bash to enter >> a deadlock. > > Thanks for the report. This has been under discussion for a long time. > > There are a couple of issues: how one satisfies users' expections of > responsiveness, and what to do with partially-read input. The work on > that continues. > > Right now, I've been running a slightly modified version of your script > (I changed the echo -n ? to echo ? to avoid stdio buffering issues) for > over an hour on a RHEL5 system without any lockups. I have ideas about > what to do to reduce the potential deadlock window, but I need a way to > measure the effect of those changes. > > Chet > > -- > ``The lyf so short, the craft so long to lerne.'' - Chaucer >``Ars longa, vita brevis'' - Hippocrates > Chet Ramey, ITS, CWRUc...@case.edu > http://cnswww.cns.cwru.edu/~chet/ > > > -- View this message in context: http://old.nabble.com/bugs-in-trap-signal-handling-tp34536400p34545570.html Sent from the Gnu - Bash mailing list archive at Nabble.com.
Need help for bash function return value
Hi, I am very new to the shell scripting.. Need some pointers for getting the return value in shell scripting. The scripts are mentioned below: I want the values ( db_host_user, db_host, ORACLE_SID) should be returned from the clonesel to test1.sh If i set the script inside the test1.sh as val=`ssh remoteserver '/bin/sh clonesel' `, then it is also not rot returning value.. Pl. advice how can I get the values in test1.sh. Thanks in advance -Tinni - I have one script as test1.sh. The script is as #!/bin/bash ssh remoteserver '/bin/sh clonesel' -- In the remote server , the script clonesel is as follows: #!/bin/bash echo echo -e "\e[1;31m\tSetup Oracle Environments \e[0m" echo -e "\t--" echo echo echo -en "\e[1;32m\tType DB OS User Name :\e[0m" read db_host_user echo echo -en "\e[1;32m\tType Database Host Name :\e[0m" read db_host echo echo -en "\e[1;32m\tType Database Name :\e[0m" read ORACLE_SID export ORACLE_SID export ORACLE_HOME=`cat /var/opt/oracle/oratab | grep -v "#" |grep $ORACLE_SID | awk -F ":" '{print $2 }'` export PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH sqlplus -s / as sysdba < /tmp/1 set echo off set head off set pause off select open_mode from v\$database; EOF db_s=`cat /tmp/1 |grep "."` echo echo -e "\e[1;33m\tDatabase Name Set to : *** $ORACLE_SID *** \e[0m" echo echo -e "\e[1;33m\tDatabase Mode Set to : *** $db_s *** \e[0m" echo echo -e "\e[1;34mPress Enter to Continue ..\e[0m" exit 0 read dummy -- -- View this message in context: http://old.nabble.com/Need-help-for-bash-function-return-value-tp34545597p34545597.html Sent from the Gnu - Bash mailing list archive at Nabble.com.
RFE: enable lost functionality: Re: How to turn off command completion on empty line?
Given this can't be done... RFE? To regain 3.x compatible behavior? Is compatibility a bad thing for some reason? Linda Walsh wrote: How do you turn off command completion on an empty line? no_empty_cmd_completion only works when you are not in the middle of a command but if you type something like declare -A var=( [val]="" the char in pasted source causes bash to corrupt input. Bash eats up characters and doesn't take input directly as typed, but asks questions. This used to function in bash 3.x, but broken sometime in 4... But it's still needed. If I hit tab at the beginning of a line, (or a line that only has blanks on it), I don't want completion. Seems simple, but last time I asked for it, no one could figure out what I was talking about...even though it worked in 3.x... So can this be fixed? or do you want a patch to revert it to 3.x behavior?