Sponsored Content
Top Forums Shell Programming and Scripting ctrl-c in bash script - Programming Post 302610365 by aish11 on Wednesday 21st of March 2012 07:27:55 AM
Old 03-21-2012
ctrl-c in bash script - Programming

Hi All,

I need to place a ctrl-c interrupt in a bash script, there is no other way, it has to be done Smilie

can someone please advise how would I go about this?

i want to use ctrl c in below code, after the code excution of just 1 min or 1sec


Code:
java Cspsamp 111.19.5.172 7025 rd1 rd1  "5022=Query|5026=109378|4=627|5=E:VD|5042=$date1|5049=$date2"


how to create the shellscript for above.

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script ctrl+c

How do you make a script so the user can not press ctrl+c and break out of the script? Thanks, :) (1 Reply)
Discussion started by: newtounix
1 Replies

2. AIX

Disable ctrl-c,ctrl-d,ctrl-d in ksh script

I wrote a ksh script for Helpdesk. I need to know how to disable ctrl-c,ctrl-z,ctrl-d..... so that helpdesk would not be able to get to system prompt :confused: (6 Replies)
Discussion started by: wtofu
6 Replies

3. UNIX for Dummies Questions & Answers

ctrl+S resulting in (i-search) in bash

Hi On solaris, when I press Ctrl+S on an XTERM, the window normally freezes. But today on the same machine, the Ctrl+S key results in (i-search) !! I understand that it has got something to do with emacs (may be not). But I do not use emacs at all. Other specific keys including <backspace>,... (3 Replies)
Discussion started by: balaji280283
3 Replies

4. UNIX for Dummies Questions & Answers

alias in bash shell for CTRL + l

Is it possible to create an alias wherein it will use a keystroke. Like to clear the screen in bash i have to use CTRL + l. I want to make an alias 'c' out of this. Thanks. (6 Replies)
Discussion started by: or_knob
6 Replies

5. UNIX for Dummies Questions & Answers

ctrl-o in bash on os X leopard -- how does it work exactly?

I'm going through "learning the bash shell" by newham and rosenblatt. I'm trying to ctro-O to execute and then go on to the next command in the history list, ctrl-o again, etc. (I'm just trying to get a feel for it in case I want to use it). But ctrl-o does nothing. Can someone help me out as to... (5 Replies)
Discussion started by: Straitsfan
5 Replies

6. Shell Programming and Scripting

Ctrl-C or Ctrl-Z causing exit the session

H! I have written script where it need to invoke the perl script in background, then write the pid in temp file then bring back the job to foreground. whenever the Ctrl-C or Ctrl-Z is pressed in the script has to exit and prompt should be dispalyed. but this script causing exit from shell session... (2 Replies)
Discussion started by: jramesh1
2 Replies

7. Shell Programming and Scripting

How to handle CTRL+Z or CTRL+C in shells script?

Hi, while executing shell script, in the middle of the process, if we kill the shell script( ctrl+z or ctrl+c), script will be killed and the files which using for the script will be in the folder. How to handle those scenarios. Is there any possibilities, if user breaks the script, I need to... (3 Replies)
Discussion started by: ckchelladurai
3 Replies

8. UNIX for Dummies Questions & Answers

Ctrl-V + Ctrl-J for newline character does not work inside vi editor

Hi friends, I am trying to add a newline char ('\n') between the query and the commit statement in the following shell script. #! /bin/sh echo "select * from tab; commit;" > data.sql I have tried typing in "Ctrl-V + Ctrl-J" combination which has inserted ^@ (NUL) character but the commit... (1 Reply)
Discussion started by: royalibrahim
1 Replies

9. Shell Programming and Scripting

Automation of keyboard inputs..like Ctrl+d and Ctrl+a

Hi..! I'm stuck with my automation of starting a process and keeping it running even after the current ssh session has exited.. So i'm trying to use command 'screen'. which is doing exactly what i wanted, But the problem is automation of the same. i will have to press Ctrl+a and Ctrl+d for... (2 Replies)
Discussion started by: chandana hs
2 Replies

10. Shell Programming and Scripting

Send ctrl-C signal using bash script.

declare -a array=( "LLC-load-misses" "LLC-loads" "LLC-store-misses" "LLC-stores" "branch-load-misses" "branch-loads" "dTLB-load-misses" "dTLB-loads" "dTLB-store-misses" "dTLB-stores" "iTLB-load-misses" "iTLB-loads" "branch-instructions" "branch-misses" "bus-cycles" "cache-misses" "cache-references"... (2 Replies)
Discussion started by: BHASKAR JUPUDI
2 Replies
term::ansi::code::ctrl(3tcl)					 Terminal control				      term::ansi::code::ctrl(3tcl)

__________________________________________________________________________________________________________________________________________________

NAME
term::ansi::code::ctrl - ANSI control sequences SYNOPSIS
package require Tcl 8.4 package require term::ansi::code ?0.1? package require term::ansi::code::ctrl ?0.1.1? ::term::ansi::code::ctrl::names ::term::ansi::code::ctrl::import ?ns? ?arg...? ::term::ansi::code::ctrl::eeol ::term::ansi::code::ctrl::esol ::term::ansi::code::ctrl::el ::term::ansi::code::ctrl::ed ::term::ansi::code::ctrl::eu ::term::ansi::code::ctrl::es ::term::ansi::code::ctrl::sd ::term::ansi::code::ctrl::su ::term::ansi::code::ctrl::ch ::term::ansi::code::ctrl::sc ::term::ansi::code::ctrl::rc ::term::ansi::code::ctrl::sca ::term::ansi::code::ctrl::rca ::term::ansi::code::ctrl::st ::term::ansi::code::ctrl::ct ::term::ansi::code::ctrl::cat ::term::ansi::code::ctrl::qdc ::term::ansi::code::ctrl::qds ::term::ansi::code::ctrl::qcp ::term::ansi::code::ctrl::rd ::term::ansi::code::ctrl::elw ::term::ansi::code::ctrl::dlw ::term::ansi::code::ctrl::eg ::term::ansi::code::ctrl::lg ::term::ansi::code::ctrl::scs0 tag ::term::ansi::code::ctrl::scs1 tag ::term::ansi::code::ctrl::sda arg... ::term::ansi::code::ctrl::sda_fgblack ::term::ansi::code::ctrl::sda_fgred ::term::ansi::code::ctrl::sda_fggreen ::term::ansi::code::ctrl::sda_fgyellow ::term::ansi::code::ctrl::sda_fgblue ::term::ansi::code::ctrl::sda_fgmagenta ::term::ansi::code::ctrl::sda_fgcyan ::term::ansi::code::ctrl::sda_fgwhite ::term::ansi::code::ctrl::sda_fgdefault ::term::ansi::code::ctrl::sda_bgblack ::term::ansi::code::ctrl::sda_bgred ::term::ansi::code::ctrl::sda_bggreen ::term::ansi::code::ctrl::sda_bgyellow ::term::ansi::code::ctrl::sda_bgblue ::term::ansi::code::ctrl::sda_bgmagenta ::term::ansi::code::ctrl::sda_bgcyan ::term::ansi::code::ctrl::sda_bgwhite ::term::ansi::code::ctrl::sda_bgdefault ::term::ansi::code::ctrl::sda_bold ::term::ansi::code::ctrl::sda_dim ::term::ansi::code::ctrl::sda_italic ::term::ansi::code::ctrl::sda_underline ::term::ansi::code::ctrl::sda_blink ::term::ansi::code::ctrl::sda_revers ::term::ansi::code::ctrl::sda_hidden ::term::ansi::code::ctrl::sda_strike ::term::ansi::code::ctrl::sda_nobold ::term::ansi::code::ctrl::sda_noitalic ::term::ansi::code::ctrl::sda_nounderline ::term::ansi::code::ctrl::sda_noblink ::term::ansi::code::ctrl::sda_norevers ::term::ansi::code::ctrl::sda_nohidden ::term::ansi::code::ctrl::sda_nostrike ::term::ansi::code::ctrl::sda_reset ::term::ansi::send::fcp row col ::term::ansi::code::ctrl::cu ?n? ::term::ansi::code::ctrl::cd ?n? ::term::ansi::code::ctrl::cf ?n? ::term::ansi::code::ctrl::cb ?n? ::term::ansi::code::ctrl::ss ?s e? ::term::ansi::code::ctrl::skd code str ::term::ansi::code::ctrl::title str ::term::ansi::code::ctrl::gron ::term::ansi::code::ctrl::groff ::term::ansi::code::ctrl::tlc ::term::ansi::code::ctrl::trc ::term::ansi::code::ctrl::brc ::term::ansi::code::ctrl::blc ::term::ansi::code::ctrl::ltj ::term::ansi::code::ctrl::ttj ::term::ansi::code::ctrl::rtj ::term::ansi::code::ctrl::btj ::term::ansi::code::ctrl::fwj ::term::ansi::code::ctrl::hl ::term::ansi::code::ctrl::vl ::term::ansi::code::ctrl::groptim str ::term::ansi::code::ctrl::clear ::term::ansi::code::ctrl::init ::term::ansi::code::ctrl::showat row col text _________________________________________________________________ DESCRIPTION
This package provides symbolic names for the ANSI control sequences. For each sequence a single command is provided which returns the sequence as its result. None of the commands of this package write to a channel; that is handled by higher level packages, like term::ansi::send. API
INTROSPECTION ::term::ansi::code::ctrl::names This command is for introspection. It returns as its result a list containing the names of all attribute commands. ::term::ansi::code::ctrl::import ?ns? ?arg...? This command imports some or all attribute commands into the namespace ns. This is by default the namespace ctrl. Note that this is relative namespace name, placing the imported command into a child of the current namespace. By default all commands are imported, this can howver be restricted by listing the names of the wanted commands after the namespace argument. SEQUENCES ::term::ansi::code::ctrl::eeol Erase (to) End Of Line ::term::ansi::code::ctrl::esol Erase (to) Start Of Line ::term::ansi::code::ctrl::el Erase (current) Line ::term::ansi::code::ctrl::ed Erase Down (to bottom) ::term::ansi::code::ctrl::eu Erase Up (to top) ::term::ansi::code::ctrl::es Erase Screen ::term::ansi::code::ctrl::sd Scroll Down ::term::ansi::code::ctrl::su Scroll Up ::term::ansi::code::ctrl::ch Cursor Home ::term::ansi::code::ctrl::sc Save Cursor ::term::ansi::code::ctrl::rc Restore Cursor (Unsave) ::term::ansi::code::ctrl::sca Save Cursor + Attributes ::term::ansi::code::ctrl::rca Restore Cursor + Attributes ::term::ansi::code::ctrl::st Set Tab (@ current position) ::term::ansi::code::ctrl::ct Clear Tab (@ current position) ::term::ansi::code::ctrl::cat Clear All Tabs ::term::ansi::code::ctrl::qdc Query Device Code ::term::ansi::code::ctrl::qds Query Device Status ::term::ansi::code::ctrl::qcp Query Cursor Position ::term::ansi::code::ctrl::rd Reset Device ::term::ansi::code::ctrl::elw Enable Line Wrap ::term::ansi::code::ctrl::dlw Disable Line Wrap ::term::ansi::code::ctrl::eg Enter Graphics Mode ::term::ansi::code::ctrl::lg Exit Graphics Mode ::term::ansi::code::ctrl::scs0 tag Set default character set ::term::ansi::code::ctrl::scs1 tag Set alternate character set Select Character Set. Choose which character set is used for either default (scs0) or alternate font (scs1). This does not change whether default or alternate font are used, only their definition. The legal tags, and their meanings, are: A United Kingdom Set B ASCII Set 0 Special Graphics 1 Alternate Character ROM Standard Character Set 2 Alternate Character ROM Special Graphics ::term::ansi::code::ctrl::sda arg... Set Display Attributes. The arguments are the code sequences for the possible attributes, as provided by the package term::ansi::code::attr. For convenience this package also provides additional commands each setting a single specific attribute. ::term::ansi::code::ctrl::sda_fgblack Set text color to Black. ::term::ansi::code::ctrl::sda_fgred Set text color to Red. ::term::ansi::code::ctrl::sda_fggreen Set text color to Green. ::term::ansi::code::ctrl::sda_fgyellow Set text color to Yellow. ::term::ansi::code::ctrl::sda_fgblue Set text color to Blue. ::term::ansi::code::ctrl::sda_fgmagenta Set text color to Magenta. ::term::ansi::code::ctrl::sda_fgcyan Set text color to Cyan. ::term::ansi::code::ctrl::sda_fgwhite Set text color to White. ::term::ansi::code::ctrl::sda_fgdefault Set default text color (Black). ::term::ansi::code::ctrl::sda_bgblack Set background to Black. ::term::ansi::code::ctrl::sda_bgred Set background to Red. ::term::ansi::code::ctrl::sda_bggreen Set background to Green. ::term::ansi::code::ctrl::sda_bgyellow Set background to Yellow. ::term::ansi::code::ctrl::sda_bgblue Set background to Blue. ::term::ansi::code::ctrl::sda_bgmagenta Set background to Magenta. ::term::ansi::code::ctrl::sda_bgcyan Set background to Cyan. ::term::ansi::code::ctrl::sda_bgwhite Set background to White. ::term::ansi::code::ctrl::sda_bgdefault Set default background (Transparent). ::term::ansi::code::ctrl::sda_bold Bold on. ::term::ansi::code::ctrl::sda_dim Dim on. ::term::ansi::code::ctrl::sda_italic Italics on. ::term::ansi::code::ctrl::sda_underline Underscore on. ::term::ansi::code::ctrl::sda_blink Blink on. ::term::ansi::code::ctrl::sda_revers Reverse on. ::term::ansi::code::ctrl::sda_hidden Hidden on. ::term::ansi::code::ctrl::sda_strike Strike-through on. ::term::ansi::code::ctrl::sda_nobold Bold off. ::term::ansi::code::ctrl::sda_noitalic Italics off. ::term::ansi::code::ctrl::sda_nounderline Underscore off. ::term::ansi::code::ctrl::sda_noblink Blink off. ::term::ansi::code::ctrl::sda_norevers Reverse off. ::term::ansi::code::ctrl::sda_nohidden Hidden off. ::term::ansi::code::ctrl::sda_nostrike Strike-through off. ::term::ansi::code::ctrl::sda_reset Reset all attributes to their default values. ::term::ansi::send::fcp row col Force Cursor Position (aka Go To). ::term::ansi::code::ctrl::cu ?n? Cursor Up. n defaults to 1. ::term::ansi::code::ctrl::cd ?n? Cursor Down. n defaults to 1. ::term::ansi::code::ctrl::cf ?n? Cursor Forward. n defaults to 1. ::term::ansi::code::ctrl::cb ?n? Cursor Backward. n defaults to 1. ::term::ansi::code::ctrl::ss ?s e? Scroll Screen (entire display, or between rows start end, inclusive). ::term::ansi::code::ctrl::skd code str Set Key Definition. ::term::ansi::code::ctrl::title str Set the terminal title. ::term::ansi::code::ctrl::gron Switch to character/box graphics. I.e. switch to the alternate font. ::term::ansi::code::ctrl::groff Switch to regular characters. I.e. switch to the default font. ::term::ansi::code::ctrl::tlc Character graphics, Top Left Corner. ::term::ansi::code::ctrl::trc Character graphics, Top Right Corner. ::term::ansi::code::ctrl::brc Character graphics, Bottom Right Corner. ::term::ansi::code::ctrl::blc Character graphics, Bottom Left Corner. ::term::ansi::code::ctrl::ltj Character graphics, Left T Junction. ::term::ansi::code::ctrl::ttj Character graphics, Top T Junction. ::term::ansi::code::ctrl::rtj Character graphics, Right T Junction. ::term::ansi::code::ctrl::btj Character graphics, Bottom T Junction. ::term::ansi::code::ctrl::fwj Character graphics, Four-Way Junction. ::term::ansi::code::ctrl::hl Character graphics, Horizontal Line. ::term::ansi::code::ctrl::vl Character graphics, Vertical Line. ::term::ansi::code::ctrl::groptim str Optimize character graphics. The generator commands above create way to many superfluous commands shifting into and out of the graphics mode. This command removes all shifts which are not needed. To this end it also knows which characters will look the same in both modes, to handle strings created outside of this package. ::term::ansi::code::ctrl::clear Clear screen. In essence a sequence of CursorHome + EraseDown. ::term::ansi::code::ctrl::init Initialize default and alternate fonts to ASCII and box graphics. ::term::ansi::code::ctrl::showat row col text Format the block of text for display at the specified location. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category term of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
ansi, attribute control, color control, control, terminal CATEGORY
Terminal control COPYRIGHT
Copyright (c) 2006-2008 Andreas Kupries <andreas_kupries@users.sourceforge.net> term 0.1 term::ansi::code::ctrl(3tcl)
All times are GMT -4. The time now is 02:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy