# Testing for an empty UNIX file using KSH on HP-UX

**URL:** <https://community.unix.com/t/testing-for-an-empty-unix-file-using-ksh-on-hp-ux/386104>\
**Category:** HP-UX\
**Created:** [April 5, 2022, 9:22pm UTC](https://community.unix.com/t/testing-for-an-empty-unix-file-using-ksh-on-hp-ux/386104 "2022-04-05T21:22:38Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Neo](https://community.unix.com/user_avatar/community.unix.com/neo/32/22838_2.png) [@Neo](https://community.unix.com/u/Neo)\
**Post date:** [April 6, 2022, 4:29am UTC](https://community.unix.com/t/testing-for-an-empty-unix-file-using-ksh-on-hp-ux/386104/9 "2022-04-06T04:29:15Z")

</div>

OK, now we know after a lot of guessing and wasted brain power, @rtb has kindly revealed he is using KSH on HP-UX ! Wow :). We finally got the basic info we need, so I changed the topic and moved the topic to HP-UX 🙂

We can all stop guessing, yea!

> [@Concatenate two values using KSH on HP-UX](https://community.unix.com/t/concatenate-two-values-using-ksh-on-hp-ux/386071/7):
>
> The operating system is HP-UNIX. The scripting is not BASH, but KSH. I’ll try to be more precise when looking for something on the internet.

So, you cannot use angle brackets in this manner in KSH

```ksh
<if test -s “$billing-file”>

```

In KSH, you need this type of syntax (from a google search to be sure), notice the square brackets.

```ksh
 if [[condition]]; then
         // Condition satisfied and run commands between if..fi
 fi

```

Kindly find a good KSH reference and use that as a guide, @rtb and post back when you have actually written some of your own KSH code to address your task. The reference below provides nearly everything you need to write KSH code to test for an empty string.

Thanks!

Reference:

[https://www.cyberciti.biz/faq/ksh-if-command-examples/](https://www.cyberciti.biz/faq/ksh-if-command-examples/)

_Note: Members (users asking questions) MUST specify your shell and OS when posting questions in a technical forum, otherwise you are wasting everyones time and energy. Time is precious. Team members should not guess or assume. It's better to know these things. If people do not post this basic information, ask for it "up front" and wait for the member to reply with this basic information, please. THANKS_

---

_[View the full topic](https://community.unix.com/t/testing-for-an-empty-unix-file-using-ksh-on-hp-ux/386104)._
