error during the execution of script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting error during the execution of script
# 1  
Old 08-24-2007
error during the execution of script

Hi,
I have a cron job which executes daily once 9 PM.

The script is like
if [ ${PRNTSHELL} = "OC" ]
then
TYPE=OC
elif [ ${PRNTSHELL} = "I" ]
then
TYPE=i
elif [ ${PRNTSHELL} = "MMC" ]
then
TYPE=mmc
elif [ ${PRNTSHELL} = "CB" ]
then
TYPE=CB
elif [ ${PRNTSHELL} = "OTH" ]
then
TYPE=oth
fi
SBTYPE=`echo $TYPE | tr [a-z] [A-Z]`

During the exection of the script some time (not always) I get the below message:
Usage: tr [ -cds ] [ String1 [ String2 ] ]
Usage: tr [ -cds ] [ String1 [ String2 ] ]


Can any one please help me. I am not able find out the cause. Please someone help me to esolve this issue.
# 2  
Old 08-24-2007
Put the args to tr in single quotes or it mas may any two character filenames in the current directory. You shouldn't need those brackets anyway. See UNIX command to reverese lower and upper case
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Stop script execution, when we encounter error

Team, Im new to shell scripting please help in below issue: Considering scenario i have 1.sql,2.sql,3.sql and 4.sql . If my second script fails my loop should come out and should not execute 3.sql and 4.sql. Here is my code. #! /bin/bash echo "exit" | user/password | grep Connected >... (4 Replies)
Discussion started by: preethi87
4 Replies

2. AIX

Error while script execution - 0403-029 there is not enough memory available now

Hi, I am executing a shell script on AIX box where I need to list all the files in the file system and then do some other tasks with them. I am able to do this successfully on HP-UX and Linux boxes but I get the following error after 10-15 seconds when I try to execute the script on an AIX box. ... (6 Replies)
Discussion started by: Adyan Faruqi
6 Replies

3. UNIX for Dummies Questions & Answers

Execution Error!

I am having output in this format.. -rw-r--r-- 1 root root 20 Jan 01 14:32 abc.txt -rw-r--r-- 1 root root 40 Jan 01 14:32 abcd.txt -rw-r--r-- (9 Replies)
Discussion started by: bhargav456
9 Replies

4. Solaris

Script on Solaris spawning 2 processes for one shell script execution

Hi, I am having a shell script on Solaris 10 which has a while loop as shown below. #!/usr/bin/ksh # while do sleep 60 done Name of the shell script is coldcentric.sh. I executed script /DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh from a command task in Informatica worklow as... (3 Replies)
Discussion started by: chekusi
3 Replies

5. Shell Programming and Scripting

Syntax error in sh script execution

Script: #!/sbin/sh echo "Welcome to my First Script" echo "Enter a word" read PASS if then echo "You are correct" elif then echo "Thats incorrect" else echo "Bye" fi When i run the script shell says: Syntax error at line 7:'elif' is not expected I ran through some old posts and... (3 Replies)
Discussion started by: Amit Kulkarni
3 Replies

6. Emergency UNIX and Linux Support

invoke one script based on previous script execution

I am database guy and not very good at shell scripts. I am seeking help to sharp my script coding. I have 5 scripts 1. master script. I use this one to call other four scripts to do database work. 2. db_backup_1 and log_backup_1 3. db_backup_2 and log_backup_2 in master script, I want to... (4 Replies)
Discussion started by: duke0001
4 Replies

7. Shell Programming and Scripting

Execution of shell script returns error 127

Hi All, While running shell script i got following output. interpreter "usr/bin/ksh" not found sh: step1.sh: not found. ldnhpux | oracle >echo $? 127 - Running command "which ksh" retruns "usr/bin/ksh". - I found some information on web stating to remove extra carriage return chars,... (8 Replies)
Discussion started by: RuchirP
8 Replies

8. UNIX for Advanced & Expert Users

SSH using shell script terminates the script execution

Hello, I am writing a shell script in which i do ssh to remote server and count the number of files there and then exit. After the exit the shell script terminates which i believe is expected behavior. Can some one suggest me a way where even after the exit the script execution resumes. ... (2 Replies)
Discussion started by: manaankit
2 Replies

9. Shell Programming and Scripting

Execution error with awk script

Hi, I run an awk script and I got the error attached below: here are the lines that the compiler point to as an error: duration = timeEnd1-timeBegin1; print "Transmission: type of traffic " flow1 ; print “ - Total transmitted bits = ” totalBits1 ” bits”; print “ - duration = ”... (2 Replies)
Discussion started by: ENG_MOHD
2 Replies

10. Shell Programming and Scripting

SolarisCron job perl script execution error

Hi, I want to run a crontab job on solaris10.5. I have configured the crontab accordingly 10 * * * * /scripts/dbalter.pl >> /scripts/cronout.txt.However this does not work .Then I go to /var/mail/root and find an error in the output:... (4 Replies)
Discussion started by: sonu2die4
4 Replies
Login or Register to Ask a Question