Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8882859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:40:48+00:00 2026-06-14T20:40:48+00:00

Background: I need to port a ksh script from SunOS 5.10 to RHEL 5.8.

  • 0

Background: I need to port a ksh script from SunOS 5.10 to RHEL 5.8. It makes a call to isql to retrieve some data and, quite contrary to the intended application of final endpoint client utilities such as isql, it parses its out to be used by a variable in the shell script. Please note that I just inherited this and by no means did design such a hack myself. I certainly never would be parsing isql out to assign value to a var in shell — if the script needed that info, I would use Perl with some API like DBD::DBI that is designed to marshall data between the application and the data store. But I have what I have and must work within the parameters.

What is happening is that the following piped input does return data on SunOS but not in RHEL:

echo "SELECT some_field FROM some_table WHERE some_crtra = 'X' \ngo" | isql -U$USER -P$PASS -D$DB -S$SERVER

That output on Solaris being:

 some_field 
 ------
 Y

(1 row affected)

From that point, the script uses awk to extract just the field value from the above stream but let’s ignore that because that’s not the problem.

Also please note that I am able to get the data executing the piped commands separately, i.e. by going manually into isql and running the SQL. So the SQL or the connection string are not the problem — it is either how the piping streams data OR isql itself works differently on the different platforms.

Can anybody see why there is disparate response to the same input on the two systems? Any idea how I can change the piping to make it work?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:40:50+00:00Added an answer on June 14, 2026 at 8:40 pm
    echo "SELECT some_field FROM some_table WHERE some_crtra = 'X' \ngo"
    

    is non portable.

    I would suggest instead:

    printf "SELECT some_field FROM some_table WHERE some_crtra = 'X' \ngo\n"
    

    From the ksh93 manual page:

    When the first arg does not begin with a -, and none of the
    arguments contain a \, then echo prints each of its arguments
    separated by a space and terminated by a new-line. Otherwise,
    the behavior of echo is system dependent and print or printf
    described below should be used.
    See echo(1) for usage and
    description.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's some background on what I'm trying to do: Open a serial port from
I come from a .NET background and need to do a web project in
I need change background of all text that have two spaces from the start
I'm coming from a Java background and trying to port a simple version of
I am developing a game. In this I need background image scrolling vertically from
Background I need to validate user input in some fields, where these are defining
I found numerous ways to send data from contents TO background.js actively. However, it
I come from a C# background and need to become more familiar with JS.
Background We need to develop a specialised CMS (internal use only) to support a
I need background transparent only for black div. but it is applying even for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.