Sponsored Content
Top Forums Shell Programming and Scripting Scripts imported from UNIX to Linux are not working Post 302976513 by laxman_bly on Thursday 30th of June 2016 05:57:27 AM
Old 06-30-2016
Scripts imported from UNIX to Linux are not working

Hi,
Recently we migrated our app from Unix to Linux platform. All our shell scripts which use to work in Unix platform are not working in Linux now.
below is such sample script. I tried removing trailing spaces, but no luck. dear experts kindly help..

Code:
#############BEGIN###############
split -l 800 $1 RC
ls -lrt RC* | awk 'print $9}' |while read line
do
echo "SAS3" >upd_supp_service_lu_ws.txt
echo "55" >>upd_supp_service_lu_ws.txt
echo "SAS_ACTION LOGIN" >>upd_supp_service_lu_ws.txt
echo "LOGIN bss" >>upd_supp_service_lu_ws.txt
echo "PASSWORD client" >>upd_supp_service_lu_ws.txt
echo "\$END\$" >>upd_supp_service_lu_ws.txt
echo "\n" >>upd_supp_service_lu_ws.txt
cat $line |while read a b c d
#       AccNo AccName GrpName Orderno
do
echo "SAS3" >>upd_supp_service_lu_ws.txt
echo "00"  >>upd_supp_service_lu_ws.txt
echo "SAS_ACTION REQUEST" >>upd_supp_service_lu_ws.txt
echo "REQ_OBJ 11" >>upd_supp_service_lu_ws.txt
echo "REQ_TYPE 1" >>upd_supp_service_lu_ws.txt
echo "NE_TYPE GVPN" >> upd_supp_service_lu_ws.txt
echo "NE_ID ITSGVPN" >> upd_supp_service_lu_ws.txt
echo "ACCOUNT_NO $a" >>upd_supp_service_lu_ws.txt
echo "ACCOUNT_NAME $b" >>upd_supp_service_lu_ws.txt
echo "GRP_NUM $c">>upd_supp_service_lu_ws.txt
echo "GRP_NAME $c" >>upd_supp_service_lu_ws.txt
echo "REQ_USER ILINK">>upd_supp_service_lu_ws.txt
echo "RESP_QUEUE_ID NONE" >>upd_supp_service_lu_ws.txt
echo "ORDER_NO $d" >>upd_supp_service_lu_ws.txt
echo "\$END\$" >>upd_supp_service_lu_ws.txt
echo "\n" >>upd_supp_service_lu_ws.txt
done
echo "55" >>upd_supp_service_lu_ws.txt
echo "SAS_ACTION LOGOUT" >>upd_supp_service_lu_ws.txt
echo "\$END\$" >>upd_supp_service_lu_ws.txt
echo "\n" >>upd_supp_service_lu_ws.txt
cat upd_supp_service_lu_ws.txt | tcp_connect localhost 44200
done
############END ############



Moderator's Comments:
Mod Comment Please use code tags as required by forum rules!

Last edited by RudiC; 06-30-2016 at 07:12 AM.. Reason: Added code tags & moved to an appropriate forum.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

pulling scripts from unix to linux

:confused: I am working on transferring "good" running code scripts from unix to linux (suse). Some errors show in linux that are not present in unix. Specifically, the error code is: codename : no closing quote This is referring to the last line of the code + one line. I have used temporary... (3 Replies)
Discussion started by: pjconfig
3 Replies

2. UNIX for Dummies Questions & Answers

Unix/Linux Scripts questions

Hi All, You have a very large file, named 'ColCheckMe', tab-delimited, that you are asked to process. You are told that each line in 'ColCheckMe' has 7 columns, and that the values in the 5th column are integers. Using shell functions (and standard LINUX/UNIX filters), indicate how you would... (7 Replies)
Discussion started by: am2007
7 Replies

3. UNIX for Dummies Questions & Answers

alias not working in scripts

Hi All, PF below details, > cat run.sh #!/usr/bin/ksh alias ll="ls -l" > ./run.sh > ll ksh: ll: not found. Pls help on this? Thanks in Advance, Naga :cool: (2 Replies)
Discussion started by: Nagapandi
2 Replies

4. Red Hat

Linux - scripts not working in cron

hi all, i have scripts executable in manully, but not working in cron. any ideas? thanks a lot? * * * * * /home/dir/dir/file.sh #! /bin/sh alarmPath="/home/dir/monitoringAlarm" alarmDateTime="$(date +%Y%m%d) $(date +%H%M%S)" tomcatPID=`pidof /usr/local/jdk1.6.0_13/bin/java` echo "tomcat... (1 Reply)
Discussion started by: maxlee24
1 Replies

5. Shell Programming and Scripting

Linux - scripts not working in cron

hi all, i have scripts executable in manully, but not working in cron. any ideas? thanks a lot? * * * * * /home/dir/dir/file.sh #! /bin/sh alarmPath="/home/dir/monitoringAlarm" alarmDateTime="$(date +%Y%m%d) $(date +%H%M%S)" tomcatPID=`pidof /usr/local/jdk1.6.0_13/bin/java` echo "tomcat... (3 Replies)
Discussion started by: maxlee24
3 Replies

6. Shell Programming and Scripting

cron job is not working for two scripts

Hi Gurus, I have a test unix server in which currently some unix cronjob are running. I have written two script one is a shell script in which env variable are there (in that i am exporting those variables). I have also written a perl script . when i am running at the shell manually like... (5 Replies)
Discussion started by: sanjay.login
5 Replies

7. Linux

It is possible to find out when a particular encryption key was imported in linux

Hi All, In linux server some encryption keys were imported using gpg command. I want to know when those keys was imported. Is there any way to get when the encryption keys were imported? Thanks in advance.. :rolleyes: (1 Reply)
Discussion started by: latika
1 Replies

8. Shell Programming and Scripting

Shell scripts migration from HP-Unix 11 to Red Hat Linux

We are changing our OS from HP-Unix 11 to Linux Red Hat. We have few k- shell, c - shell and sql scripts which are currently running under HP-Unix 11. Will these scripts work on LINUX as it is? or we need to do any code changes?IS there anyone who have done this kind of migration before?Thanks for... (2 Replies)
Discussion started by: Phoenix2
2 Replies

9. UNIX for Dummies Questions & Answers

Alternate of UNIX scripts in Linux

Hai All, Greetings.... I am doing a migration from Solaris to Linux .There are few scripts (logadm, nfsfind, gsscred_clean, kprop_script) for which I need a alternate in Linux. If somebody can help. Thanks in advance (1 Reply)
Discussion started by: Dilipkumarkm
1 Replies
All times are GMT -4. The time now is 07:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy