Sponsored Content
Full Discussion: Additional character output
Top Forums Shell Programming and Scripting Additional character output Post 74817 by negixx on Monday 13th of June 2005 03:34:23 PM
Old 06-13-2005
Additional character output

Hi there,

I am just wondering if somebody can help me find out why am I getting additional characters on my "echo" command to create a text file. Here's my unix script :

#!/bin/ksh
#============================================================
# Script Name : chk_ORDHD.ksh
# Description : This script checks for XORD* files with
# incorrect HD count value
#============================================================

. /glo71sw/pro4bin/crondevl716
DIRSCRIPT=$PRODATA/scripts
cd $PRODATA
XORDDOWNLD=`ls XORD????.DLD`
export XORDDOWNLD
echo $XORDDOWNLD >> jgo.log

# clear report files....
> check_ORDHD.incorrect
> check_ORDHD.correct

for i in $XORDDOWNLD
do

# after getting the file, make sure header count is correct.
TOT_CNT=`cat $i | wc -l`
TOT_HD=`cat $i | grep "HD" | cut -c17-25`
# Compare total lines with total count in HD record
if [ $TOT_CNT -eq $TOT_HD ]
then
echo "$i has correct count : $TOT_CNT" >> check_ORDHD.correct
else
echo "$i has incorrect count : HD = $TOT_HD, Record = $TOT_CNT" >> check_O
RDHD.incorrect
fi
done

if [ -s check_ORDHD.incorrect ]
then
cat check_ORDHD.incorrect | elm -s"ORD Files with incorrect HD" test@test.com
fi



And then when I run this, I get the following email output. I am not sure where the extra "U" and "B" are coming from :
XORD0001.DLD has incorrect count : HD = 000000005, Record = 61
XORD0002.DLD has incorrect count : HD = 000000040, Record = 43
XORD0003.DLD has incorrect count : HD = 000000028
U
U
B, Record = 139
XORD0004.DLD has incorrect count : HD = 000000100
U
U
B, Record = 213
XORD0005.DLD has incorrect count : HD = 000000033
U
U, Record = 108
XORD0007.DLD has incorrect count : HD = 000000008, Record = 57


Thanks!

Joseph
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

sqlPlus output with new line character

Hi, I have a script which calls a sqlplus command and i'm saving the output in a variable. Z=`sqlplus -s $TC_ORACLE_USER/$TC_ORACLE_PASSWORD@$TC_CONNECT_STRING <<eof set echo off set head off set serveroutput on; set feedback off; select description from period where trunc(sysdate)... (2 Replies)
Discussion started by: decci_7
2 Replies

2. Shell Programming and Scripting

Getting output on the behalf of a character

Hi all, I want to get show an entire line of a output on the behalf of a single character. Hope, its easy but not for me. I am giving an example of my task: -rw-r--r-- 1 dtiwari_x mkpasswd 0 Dec 30 19:02 =5 -rw-r--r-- 1 dtiwari_x mkpasswd 61952 Jan 7 18:32 Customizing the... (3 Replies)
Discussion started by: naw_deepak
3 Replies

3. UNIX for Dummies Questions & Answers

SED: Can't Repeat Search Character in SED Output

I'm not sure if the problem I'm seeing is an artifact of sed or simply a beginner's mistake. Here's the problem: I want to add a zero-width space following each underscore between XML tags. For example, if I had the following xml: <MY_BIG_TAG>This_is_a_test</MY_BIG_TAG> It should look like... (8 Replies)
Discussion started by: rhetoric101
8 Replies

4. Shell Programming and Scripting

Bad character in output file

Hi All, I am facing some problems with bad characters in my file.For example- 00000000509 TCI DEVOFFERS= 1 Now I want to remove all bad characters and replace with *. Please suggest some solution. Along with that How to mention a range of ASCII values in TR command to replace? ... (2 Replies)
Discussion started by: bghosh
2 Replies

5. UNIX for Dummies Questions & Answers

Removing unnecessary eol ($) character from Oracle sql query output

Hi All, I am fetching oracle query result in shell variable. As columns numbers are more the output wraps in unix terminal .i.e one complete record in db gets store in multiple lines. with each line ends with $ character. I want to remove these unnecessary $ character but to keep required $... (8 Replies)
Discussion started by: Harshal22
8 Replies

6. Shell Programming and Scripting

Oneliner ---split string to character by piping shell output to perl

Hello, I was trying to split a string to characters by perl oneliner. echo "The quick brown fox jumps over the lazy dog" | perl -e 'split // ' But did not work as with bash script pipe: echo "The quick brown fox jumps over the lazy dog" | fold -w1 | sort | uniq -ic 8 1 T 1... (6 Replies)
Discussion started by: yifangt
6 Replies

7. UNIX for Dummies Questions & Answers

PS1 (Prompt character) appearing in cat output

RedHat Linux 5.8/Korn Shell I have text file name /etc/oracle/config.loc. It has the following text #Device/file getting replaced by device +OCR ocrconfig_loc=+DATA ocrmirrorconfig_loc=+OCRBut , when I open this file using cat , the PS1 character (for prompt) appears as the last character... (8 Replies)
Discussion started by: omega3
8 Replies

8. Shell Programming and Scripting

Help with if else with additional condition

Input file: 3420023_3422482,3422486_3423070 46910 1795263_1798343 32681 1837399_1838886 1534 2148674_2149696,2149698_2149772 10203 3825382_3825555,3827296_3827900 198 1839890_1840294 72 . . Output file 3420023_3422482,3422486_3423070 3420023_3422482,3422486_3423070 46910 1795263... (1 Reply)
Discussion started by: perl_beginner
1 Replies

9. UNIX for Beginners Questions & Answers

Separating output after final character

I'm trying to write a script that will email the contents of my Application folder to me. cd /Applications ListApps=$(ls) echo $ListApps | mail -s "Application Check" myself@myemail.com This sends it in a paragraphed block i.e: Adobe Acrobat Reader.app App Store.app Atom.app... (4 Replies)
Discussion started by: $shell_Learner
4 Replies

10. Shell Programming and Scripting

Use awk to turn character to newline then scan output

i have a datafile (data.txt) that has the following data: #Beginner`echo... (4 Replies)
Discussion started by: SkySmart
4 Replies
shells(4)							   File Formats 							 shells(4)

NAME
shells - shell database SYNOPSIS
/etc/shells DESCRIPTION
The shells file contains a list of the shells on the system. Applications use this file to determine whether a shell is valid. See getuser- shell(3C). For each shell a single line should be present, consisting of the shell's path, relative to root. A hash mark (#) indicates the beginning of a comment; subsequent characters up to the end of the line are not interpreted by the routines which search the file. Blank lines are also ignored. The following default shells are used by utilities: /bin/bash, /bin/csh, /bin/jsh, /bin/ksh, /bin/pfcsh, /bin/pfksh, /bin/pfsh, /bin/sh, /bin/tcsh, /bin/zsh, /sbin/jsh, /sbin/sh, /usr/bin/bash, /usr/bin/csh, /usr/bin/jsh, /usr/bin/ksh, /usr/bin/pfcsh, /usr/bin/pfksh, /usr/bin/pfsh, and /usr/bin/sh, /usr/bin/tcsh, /usr/bin/zsh. Note that /etc/shells overrides the default list. Invalid shells in /etc/shells may cause unexpected behavior (such as being unable to log in by way of ftp(1)). FILES
/etc/shells lists shells on system SEE ALSO
vipw(1B), ftpd(1M), sendmail(1M), getusershell(3C), aliases(4) SunOS 5.10 4 Jun 2001 shells(4)
All times are GMT -4. The time now is 06:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy