08-05-2010
Thank you all guys... the set - x was especially helpful!
cheers
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
echo "input time in hhmmss"
read $st
h=`echo $st | cut -c1-2`
min=`echo $st | cut -c3-4`
s=`echo $st | cut -c5-6`
echo "input time in hhmmss"
read $end
h1=`echo $end | cut -c1-2`
min1=`echo $end | cut -c3-4`
s1=`echo $end | cut -c5-6`
x= `expr $h /* 60 + $min`
y= `expr $h1 /* 60 +... (8 Replies)
Discussion started by: abhishek27
8 Replies
2. UNIX for Advanced & Expert Users
Hi all,
i have two simple questions here...
1. i want to know that how to debug the UNIX shell script?
2. is there any way to handling the exception in UNIX shell script like oracle exception handling?
Please provide me those details it would be great help/
Thanks and Regards,
MPS... (3 Replies)
Discussion started by: psiva_arul
3 Replies
3. Shell Programming and Scripting
Hi Buddies,
The following is shell scripts which was borrowed from linux box for load average check. it runs good.
(this structure is simple, when load average is too high, it will send alert to user)
#!/usr/bin/ksh
# Set threshold for 1, 5 and 15 minture load avarage
# configured for... (4 Replies)
Discussion started by: GreatJerry
4 Replies
4. Shell Programming and Scripting
Hi,
When i run the script ./script.sh sun, this give me no output, it should give me the list of file.
If i run the script without the argument it should send me echo inside usage().
What is the problem?
please help
-Adsi
#!/bin/sh
ROOT_PATH=/net/icebox/vol/local_images/spins... (2 Replies)
Discussion started by: asirohi
2 Replies
5. Shell Programming and Scripting
Hi,
I have this script, searches and sets variables, then searches and sets more variables from multiple files.
I'd need to debug it a bit.
#!/bin/bash
egrep $1 `find | grep MAGT` >/tmp/resRA-$$
thread=`sed -n '/{0x/ {s/^.*{0x\(*\).*/\1/p;q}' /tmp/resRA-$$`
tag=`sed -n '/Tag=/... (5 Replies)
Discussion started by: Vitoriung
5 Replies
6. Shell Programming and Scripting
I know about bash -x, set -x and -v but disappears from Command Line Interface in fraction of second ......
I am looking for a command or script ..complies each line and shows the output after executing each line ....( similar what we have in C )
Thanks in Advance (2 Replies)
Discussion started by: frintocf
2 Replies
7. Shell Programming and Scripting
I have a shell program which calls a perl program.
I am running the shell program with command;
$ ksh -x <prog_name>
Inside the shell program, I am calling perl with warnings.
I want to capture the entire output as it comes on screen.
The command I tried is:
$ ksh -x... (1 Reply)
Discussion started by: som.nitk
1 Replies
8. Ubuntu
How can I debug this script?
I want to know what it is doing or not doing?
#!/bin/bash
#
#
if ; then
# Do the thing you want before suspend here
echo "we are suspending." > /tmp/systemd_suspend_test.txt
elif ; then
# Do the thing you want after resume here
echo "and we are... (21 Replies)
Discussion started by: drew77
21 Replies
9. UNIX for Beginners Questions & Answers
Hello All,
I have got a section of shell script which was working earlier but now it is giving some different results:
MSG=
while true
do
themenu
getchar =
case $answer in
1) export_Config_tables;;
2) export_config_tables_file;;
3)... (1 Reply)
Discussion started by: bghosh
1 Replies
LEARN ABOUT DEBIAN
marc::charset
MARC::Charset(3pm) User Contributed Perl Documentation MARC::Charset(3pm)
NAME
MARC::Charset - convert MARC-8 encoded strings to UTF-8
SYNOPSIS
# import the marc8_to_utf8 function
use MARC::Charset 'marc8_to_utf8';
# prepare STDOUT for utf8
binmode(STDOUT, 'utf8');
# print out some marc8 as utf8
print marc8_to_utf8($marc8_string);
DESCRIPTION
MARC::Charset allows you to turn MARC-8 encoded strings into UTF-8 strings. MARC-8 is a single byte character encoding that predates
unicode, and allows you to put non-Roman scripts in MARC bibliographic records.
http://www.loc.gov/marc/specifications/spechome.html
EXPORTS
ignore_errors()
Tells MARC::Charset whether or not to ignore all encoding errors, and returns the current setting. This is helpful if you have records
that contain both MARC8 and UNICODE characters.
my $ignore = MARC::Charset->ignore_errors();
MARC::Charset->ignore_errors(1); # ignore errors
MARC::Charset->ignore_errors(0); # DO NOT ignore errors
assume_unicode()
Tells MARC::Charset whether or not to assume UNICODE when an error is encountered in ignore_errors mode and returns the current setting.
This is helepfuli if you have records that contain both MARC8 and UNICODE characters.
my $setting = MARC::Charset->assume_unicode();
MARC::Charset->assume_unicode(1); # assume characters are unicode (utf-8)
MARC::Charset->assume_unicode(0); # DO NOT assume characters are unicode
assume_encoding()
Tells MARC::Charset whether or not to assume a specific encoding when an error is encountered in ignore_errors mode and returns the current
setting. This is helpful if you have records that contain both MARC8 and other characters.
my $setting = MARC::Charset->assume_encoding();
MARC::Charset->assume_encoding('cp850'); # assume characters are cp850
MARC::Charset->assume_encoding(''); # DO NOT assume any encoding
marc8_to_utf8()
Converts a MARC-8 encoded string to UTF-8.
my $utf8 = marc8_to_utf8($marc8);
If you'd like to ignore errors pass in a true value as the 2nd parameter or call MARC::Charset->ignore_errors() with a true value:
my $utf8 = marc8_to_utf8($marc8, 'ignore-errors');
or
MARC::Charset->ignore_errors(1);
my $utf8 = marc8_to_utf8($marc8);
utf8_to_marc8()
Will attempt to translate utf8 into marc8.
my $marc8 = utf8_to_marc8($utf8);
If you'd like to ignore errors, or characters that can't be converted to marc8 then pass in a true value as the second parameter:
my $marc8 = utf8_to_marc8($utf8, 'ignore-errors');
or
MARC::Charset->ignore_errors(1);
my $utf8 = marc8_to_utf8($marc8);
DEFAULT CHARACTER SETS
If you need to alter the default character sets you can set the $MARC::Charset::DEFAULT_G0 and $MARC::Charset::DEFAULT_G1 variables to the
appropriate character set code:
use MARC::Charset::Constants qw(:all);
$MARC::Charset::DEFAULT_G0 = BASIC_ARABIC;
$MARC::Charset::DEFAULT_G1 = EXTENDED_ARABIC;
SEE ALSO
o MARC::Charset::Constant
o MARC::Charset::Table
o MARC::Charset::Code
o MARC::Charset::Compiler
o MARC::Record
o MARC::XML
AUTHOR
Ed Summers (ehs@pobox.com)
perl v5.12.4 2011-08-05 MARC::Charset(3pm)