Skip to content
Initially centered on mainframes, this website now explores a range of computing topics
EXECPGM
  • About
  • Link Pack Area
  • Principles of Doing IT
  • Toggle website search
  • About
  • Link Pack Area
  • Principles of Doing IT
  • Toggle website search

Test if a directory exists in z/OS Unix System Services

  • Post published:October 13, 2022
  • Post category:Utilities

Snippet of shell script code to test if a directory exists in z/OS Unix System Services.

#!/bin/sh                                
DEST="/app/somedirectory"                        
if test -d "$DEST"                       
then                                     
    # It is a directory #                
    echo "Directory found ..."           
else                                     
    # does not exist                     
    echo "Directory does not exist"      
fi            
Ask me anything

Recent Posts

  • Automation: From Repetition to Engineering
  • The Cathedral Effect: Designing Engineering Spaces for Creativity and Focus
  • zopen community – open source tools for Z
  • dos2unix on z/OS
  • The 4 Eyes Principle

Subscribe

Archives

  • May 2025
  • November 2024
  • October 2024
  • September 2024
  • July 2024
  • June 2024
  • March 2024
  • November 2023
  • August 2023
  • July 2023
  • June 2023
  • October 2022
  • August 2022
  • April 2022
  • February 2022
  • January 2022
  • December 2021
  • September 2021
  • July 2021
  • June 2021
  • May 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • August 2020
  • May 2020
  • March 2020
  • October 2019
  • September 2019

Except where otherwise noted, this website is licensed under a Creative Commons CC BY-NC-SA 3.0 – https://creativecommons.org/licenses/by-nc-sa/3.0/. CC-BY-NC-SA icon