Sponsored Content
Full Discussion: trap command
Top Forums UNIX for Dummies Questions & Answers trap command Post 302511852 by methyl on Thursday 7th of April 2011 06:34:02 PM
Old 04-07-2011
I agree with the rest that the signal is somehow disabled.

Whether you have INT or 2 in the signal name, this could be a better construct for a test script because it lets you exit the script.

Code:
trap 'echo You hit control-C!;exit' INT
while true; do
sleep 60
done

Perhaps try positively setting the key as the first line of the script.
Code:
stty intr '^C'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using TRAP command

I'm using the trap command to capture any signals received whilst my script is running. How's the best way of writing the signal and any other error messages to a file/error log' without having to type '2>$1' on the command line after the script name? Cheers (3 Replies)
Discussion started by: dbrundrett
3 Replies

2. UNIX for Dummies Questions & Answers

trap command

i have the following script that displays the current time until the user presses CTR + c.... but it does not work properly.... Something is not right with the trap command... Help plz... :confused: # script to continuously display current time. # if script is terminated trap signal... (3 Replies)
Discussion started by: onlyc
3 Replies

3. UNIX for Dummies Questions & Answers

trap command

Dear All could you please explain me what does the trap command do and how I can write a program which can work as a trap command(in C Language). (1 Reply)
Discussion started by: mobile01
1 Replies

4. Programming

trap command in Unix

Could anybody tell me what the trap command does and how it performs the action it does. I had read the trap manual page but it is too concise that nothing is clear about it. Please tell how it works. (1 Reply)
Discussion started by: mobile01
1 Replies

5. Shell Programming and Scripting

Use of TRAP Command

Hi, I would like to know the use of TRAP command. I am very new to the UNIX environment. I have just started learning the basic. So please teach me in a very simple way to understand. Also i would like to know the use of following command: trap 'dialog --msgbox "Script Aborted1" 6 50 ;... (2 Replies)
Discussion started by: Deepakh
2 Replies

6. Shell Programming and Scripting

Cntl+z Trap is not detecting ??? Help required to add a trap detection ???

Hi folks, I have tried to add some trap detection in the below script....this script is used to monitor database activities...in a rather awkward way :rolleyes:.... The idea behind adding trap is that....this script creates lots of temporary files in the running folder to store the count... (1 Reply)
Discussion started by: frozensmilz
1 Replies

7. UNIX for Advanced & Expert Users

trap command

Hello experts! I need to know the use of trap command please In one of our program we have trap "rm -f temp1 ; exit 1" 1 2 15 0 and program always exit with 1 there is a rm -f temp1 as well at the end of the program as rm -f temp1 exit 0 when I test a probram with set... (4 Replies)
Discussion started by: ramshree01
4 Replies

8. Shell Programming and Scripting

trap command

dear all; I can't under stand what does "trap" command do: for example see below: trap "echo; echo no interrupts >&2; sleep 3" 2 3 15 Plz , can any body explain the action of this command? BR (3 Replies)
Discussion started by: ahmad.diab
3 Replies

9. Homework & Coursework Questions

VM trap may work differently than a pure install trap.

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: That is the last reply I received from my instructor, and I'm looking for some alternatives. When using... (2 Replies)
Discussion started by: newuser45
2 Replies

10. Shell Programming and Scripting

Trap command not working

Hi Folks - For some reason, my trap command is not working. It's placed just prior to a normal exit: #:: ------------------------------------------------------------------------ #::-- Script Name: LCM_Backup.sh #:: #::-- Description: This script leverages Utility.sh to perform LCM... (16 Replies)
Discussion started by: SIMMS7400
16 Replies
Locale::Script(3)					User Contributed Perl Documentation					 Locale::Script(3)

NAME
Locale::Script - standard codes for script identification SYNOPSIS
use Locale::Script; $script = code2script('phnx'); # 'Phoenician' $code = script2code('Phoenician'); # 'Phnx' $code = script2code('Phoenician', LOCALE_CODE_NUMERIC); # 115 @codes = all_script_codes(); @scripts = all_script_names(); DESCRIPTION
The "Locale::Script" module provides access to standards codes used for identifying scripts, such as those defined in ISO 15924. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 15924 four-letter codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying scripts. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $script = code2script('phnx','alpha'); $script = code2script('phnx',LOCALE_SCRIPT_ALPHA); The codesets currently supported are: alpha, LOCALE_SCRIPT_ALPHA This is a set of four-letter (capitalized) codes from ISO 15924 such as 'Phnx' for Phoenician. It also includes additions to this set included in the IANA language registry. The Zxxx, Zyyy, and Zzzz codes are not used. This is the default code set. num, LOCALE_SCRIPT_NUMERIC This is a set of three-digit numeric codes from ISO 15924 such as 115 for Phoenician. ROUTINES
code2script ( CODE [,CODESET] ) script2code ( NAME [,CODESET] ) script_code2code ( CODE ,CODESET ,CODESET2 ) all_script_codes ( [CODESET] ) all_script_names ( [CODESET] ) Locale::Script::rename_script ( CODE ,NEW_NAME [,CODESET] ) Locale::Script::add_script ( CODE ,NAME [,CODESET] ) Locale::Script::delete_script ( CODE [,CODESET] ) Locale::Script::add_script_alias ( NAME ,NEW_NAME ) Locale::Script::delete_script_alias ( NAME ) Locale::Script::rename_script_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Script::add_script_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Script::delete_script_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.unicode.org/iso15924/ Home page for ISO 15924. http://www.iana.org/assignments/language-subtag-registry The IANA language subtag registry. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 1997-2001 Canon Research Centre Europe (CRE). Copyright (c) 2001-2010 Neil Bowers Copyright (c) 2010-2013 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.3 2013-06-03 Locale::Script(3)
All times are GMT -4. The time now is 10:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy