• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1091
  • Last Modified:

keyboard Error in .ksh

When i run korn shell program, I get this error:
could not open /dev/kbd to get keyboard type US keyboard assumed


mokshs@moppgpiaissdwp1/export/home/autosys/output> pg 2789967-1_usp.lyrica_phoen_load_4.err
could not open /dev/kbd to get keyboard type US keyboard assumed
could not get keyboard type US keyboard assumed
/status/separate_file.ksh[38]: /status/files/pfi_rejects20071006.txt_/iaprod/bin/lyrica/phoenix/status/separated/pfi_rej.txt: cannot create
could not open /dev/kbd to get keyboard type US keyboard assumed
could not get keyboard type US keyboard assumed
/status/separate_file.ksh[38]: /status/files/pfi_rejects20071006.txt_/iaprod/bin/lyrica/phoenix/status/files/pfi_rejects20071006.txt_hdr.txt.txt: cannot create
/status/separate_file.ksh[42]: /status/files/pfi_rejects20071006.txt_/iaprod/bin/lyrica/phoenix/status/files/pfi_rejects20071006.txt_REJP.txt.txt: cannot create

Return is 2
0
gram77
Asked:
gram77
  • 2
2 Solutions
 
gram77Author Commented:
command dos2unix is used in the script
0
 
gram77Author Commented:
Here is the script:


/status> cat phoenix_brc_created_processing.ksh
#!/usr/bin/ksh

################################################################################
# Name: phoenix_brc_created_processing.ksh
# Title: Load Monthly BRC Created Information
# Purpose: This file loads the monthly BRC Created information into the database.
#
################################################################################

#set -xv

TODAY_DATE=`date +%Y%m%d`
IAPRODBIN="/iaprod/bin"
LYRICA_HOME="${IAPRODBIN}/lyrica"
PHOENIX_STATUS_DIR="${LYRICA_HOME}/phoenix/status"
PHOENIX_STATUS_FILES_DIR="${LYRICA_HOME}/phoenix/status/files"
SEPARATED_FILES_DIR="${LYRICA_HOME}/phoenix/status/separated"
LOGFILE="${LYRICA_HOME}/log/phoenix_status_all_brc_load_${TODAY_DATE}.log"
ARCHIVE_DIR="/c001/sds/lyrica"
FILEPATTERN="PFI_CreatedBRCs*"
FILENAME="${PHOENIX_STATUS_FILES_DIR}/${FILEPATTERN}"

#exec >> $LOGFILE 2>&1

echo "BRC Created Load Starting!\n"

# Error if there are no lines
if ((`ls -l ${PHOENIX_STATUS_FILES_DIR} | grep $FILEPATTERN | wc -l` < 1))
then
        msg="BRC Created files were not found, on `date`.\n"
        echo $msg
        exit 0
fi

ls -1 $FILENAME > listofBRCCreatedweeks

# For all of the files we will load them
while read sLine
do
        dos2unix $sLine $sLine

        # Use Regular expression to retrieve the date in the form of YYYYMMDD
        MONTH_FORMAT1=`echo $sLine | sed -n -e "s/\(.*\)\([0-9]\{8\}\)\(.*\)/\2/p"`  #YYYYMMDD

        # Convert the date to MM/DD/YYYY and change the day to the first to represent the month
        MONTH=`echo $MONTH_FORMAT1 | sed -n -e "s/\(....\)\(..\)\(..\)/\2\/01\/\1/p"`

        $PHOENIX_STATUS_DIR/separate_file.ksh $sLine ${SEPARATED_FILES_DIR}/pfi_created
        if [ -s ${SEPARATED_FILES_DIR}/pfi_created* ]
        then
           $IAPRODBIN/run_dsjob.ksh ellis iaprod iaprod lyrica LoadLyricaPhoenixBrcCreatedNew 0 -param Month=${MONTH} >> 

$LOGFILE

           errcd=${?}
           if [ ${errcd} -eq 0 ]
           then
                echo "BRC Created DataStage Job done for file: $sLine\n"
           else
                echo "BRC Created DataStage Job failed for file: $sLine\n"
           fi
           #rm ${SEPARATED_FILES_DIR}/*
        else
           echo "BRC Created failed because of no separated files for file: $sLine\n"
        fi

done < listofBRCCreatedweeks

mv ${PHOENIX_STATUS_FILES_DIR}/PFI_CreatedBRCs* ${ARCHIVE_DIR}

echo "BRC Created Load Finished!\n"

exit 0
0
 
TintinCommented:
Depending on your version of dos2unix, either do

dos2unix -q $sLine $sLine

or

dos2unix $sLine $sLine 2>/dev/null

0
 
Duncan RoeSoftware DeveloperCommented:
I think the kbd stuff is just a warning, and not your real problem. However you asked about it, so here goes:
This is the command to create the kbd device

08:42:19# mknod /dev/kbd c 11 0

If you are using UDEV, you need to persist this over reboots:

08:43:37# mknod /lib/udev/devices/kbd c 11 0
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now