Scripts imported from UNIX to Linux are not working


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Scripts imported from UNIX to Linux are not working
# 8  
Old 07-13-2016
Quote:
Originally Posted by laxman_bly
May be issue is with new line char, i am unsure! But i noticed one difference between HP-UX and Linux platforms. i.e., echo "\n" in unix (sh) prints new line but in Linux (ksh) echo "\n" prints \n as output.
Actually this has nothing to do with your OS but everything with your shell. If i remember correctly HP-Ux uses a Korn shell as system default (not sure about that) and if this is the case then echo \n should indeed output "\n", as with the Linux ksh.

Use the print command instead of echo if you are working with the Korn shell.

I hope this helps.

bakunin
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
Login or Register to Ask a Question
ATF-SH(1)						    BSD General Commands Manual 						 ATF-SH(1)

NAME
atf-sh [-s shell] -- interpreter for shell-based test programs SYNOPSIS
atf-sh script DESCRIPTION
atf-sh is an interpreter that runs the test program given in script after loading the atf-sh(3) library. atf-sh is not a real interpreter though: it is just a wrapper around the system-wide shell defined by ATF_SHELL. atf-sh executes the inter- preter, loads the atf-sh(3) library and then runs the script. You must consider atf-sh to be a POSIX shell by default and thus should not use any non-standard extensions. The following options are available: -s shell Specifies the shell to use instead of the value provided by ATF_SHELL. ENVIRONMENT
ATF_LIBEXECDIR Overrides the builtin directory where atf-sh is located. Should not be overridden other than for testing purposes. ATF_PKGDATADIR Overrides the builtin directory where libatf-sh.subr is located. Should not be overridden other than for testing purposes. ATF_SHELL Path to the system shell to be used in the generated scripts. Scripts must not rely on this variable being set to select a specific interpreter. EXAMPLES
Scripts using atf-sh(3) should start with: #! /usr/bin/env atf-sh Alternatively, if you want to explicitly choose a shell interpreter, you cannot rely on env(1) to find atf-sh. Instead, you have to hardcode the path to atf-sh in the script and then use the -s option afterwards as a single parameter: #! /path/to/bin/atf-sh -s/bin/bash ENVIRONMENT
ATF_SHELL Path to the system shell to be used in the generated scripts. SEE ALSO
atf-sh(3) BSD
September 27, 2014 BSD