Script does not stop when doing a read


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script does not stop when doing a read
# 8  
Old 11-05-2007
The use of the null ":" command

The colon ":" as a NULL command can be quite useful for debug output. A line that begins with ":" is not executed, but it is evaluated. So instead of this:

Code:
echo "The value of VAL is '$VAL'."

do this:

Code:
: The value of VAL is '$VAL'.

The latter will only show when "set -x" is used, and only once; the former show up twice in the debug output.

BUT, since it is evaluated, care must be taken. For instance:

Code:
: This won't work!

The apostophe in "won't" is evaluated and treated like an unmatched single-quote.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Read in numbers from console won't stop at newline.

Hello, I have snippet code from Lippman's <<C++ primer>>. The program is to convert regular decimal (0 ~ 15) numbers to basic hexdecimals. The instruction tells the program will execute by hitting newline at the end. When I tried to run the compiled program, hitting ENTER did not work as... (3 Replies)
Discussion started by: yifangt
3 Replies

2. Shell Programming and Scripting

Read command stop on either EOF or a specific line

I'm trying to stop reading a file until the end of the file is reached or a defined delimiter line is reached. Some how I need to test the fail state of the last 2 commands, not just the last command. echo -e "hello\ngoodbye\n####\ntesting" | while read line; ]; do echo "$line"; done hello... (4 Replies)
Discussion started by: Michael Stora
4 Replies

3. Shell Programming and Scripting

Loop to read parameters and stop

Hey guys, How do I make a loop that reads all the parameters en then stop when there are no parameters anymore ? Something that gives an output like this: ./Script.sh parameter1 parameter2 parameter3 parameter = parameter1 parameter = parameter2 parameter = parameter3 Thanks a lot,... (5 Replies)
Discussion started by: Miki1579
5 Replies

4. Shell Programming and Scripting

Stop child script by stoping parent script

Hi everyone, I have this problem with a script I'm writting. I want to execute a code running in the background several times through a script. I am writting it like that parent_script for a in 1 2 3 4 5 do exec test -n $a done What I want to do is when parent_script is killed,... (0 Replies)
Discussion started by: geovas
0 Replies

5. Shell Programming and Scripting

read a string from its end to its start and stop when you find a specific character

How can I do this? Actually I have a file which contains a path e.g. /home/john/Music/hello.mp3 and I want to take only the filename (hello.mp3) So, I need to read the file from its end to its start till the character "/" Is this possible? Thanks, I am sure you'll not disappoint me here! Oh,... (9 Replies)
Discussion started by: hakermania
9 Replies

6. Shell Programming and Scripting

How to stop a script running in remote server from local script

Hi, I have googled for quite some time and couldn't able to get what exactly I am looking for.. My query is "how to stop a shell script which is running inside a remote server, using a script"??? can any one give some suggestions to sort this out. (1 Reply)
Discussion started by: mannepalli
1 Replies

7. Shell Programming and Scripting

script don't stop

Hello everybody! I am new to this and I am trying to change a script in an open source program that plots some offset vectors and then calls a postscript viewer. I have commented away the call for the postscript viewer but somehow the script doesn't return to the shell prompt. I cant figure out... (3 Replies)
Discussion started by: larne
3 Replies

8. UNIX for Dummies Questions & Answers

Stop a shell script

Hi, I am writing a bash shell script. How can I tell it to stop. For example, I would like to have something similar to the following: mike=1 if ; then STOP THE SCRIPT fi (3 Replies)
Discussion started by: msb65
3 Replies

9. Shell Programming and Scripting

Script to run non-stop

Hi All, I am on a Solaris OS and i have come up with a csh script named " mycshscript " which will grab data from a datalog file & format the grabbed data & upload formated version to web server. I would want to have this script to run non-stop so that the latest can be captured since data is... (37 Replies)
Discussion started by: Raynon
37 Replies

10. UNIX for Dummies Questions & Answers

Script that doesn't stop

Hi all, I got a script that runs automatically using the cron file. The script starts running at midnight and suppose to delete image files from folders and sub-folders. The script ends when he finishes deleting or after 5 hours. My problem is that the script doesn't stop running even after 5... (3 Replies)
Discussion started by: biot
3 Replies
Login or Register to Ask a Question
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)