---
name: "popen_nosh"
section: "3"
platform: "linux"
package: "libexecs-dev"
version: "1.4-2+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/popen_nosh"
---

# popen\_nosh(3)

pipe stream to or from a process without using a shell

## NAME

popen\_nosh, pclose\_nosh, popen\_execs, pclose\_execs, - pipe stream to or from a process without using a shell

## SYNOPSIS

**#include \<stdio.h\>**\
 **#include \<execs.h\>**

**FILE \*popen\_nosh(const char \****command***, const char \****type***);**\
 **int pclose\_nosh(FILE \****stream***);**

**FILE \*popen\_execsp(const char \****command***, const char \****type***);**\
 **int pclose\_execsp(FILE \****stream***);**

**FILE \*popen\_execs(const char \****path***,const char \****command***, const char \****type***);**\
 **int pclose\_execs(FILE \****stream***);**

These functions are provided by libexecs. Link with *-lexecs*.

## DESCRIPTION

**popen\_nosh**, **popen\_execsp** and **pclose\_nosh** are almost drop in replacement for [**popen**(3)](/popen/3.md) and [**pclose**(3)](/pclose/3.md) provided by the libc. **popen\_nosh** and **popen\_execsp** are synonyms: they parse the command string and run the command directly, without using a shell.\
 Command arguments in *args* are delimited by space characters (blank, tabs or new lines). Single or double quotes can be used to delimitate command arguments including spaces and a non quoted backslash (**\\**) is the escape character to protect the next char. The executable file is sought using the PATH environment variable as explained for [**execlp**(3)](/execlp/3.md).\
 **pclose\_nosh** closes a stream opened by **popen\_nosh**.\
 **popen\_execs** requires the path of the executable to be specified as its first parameter so it does not use the PATH environment variable. **pclose\_execs** closes a stream opened by **popen\_execs**.

## RETURN VALUE

These functions have the same return values of [**popen**(3)](/popen/3.md) and [**pclose**(3)](/pclose/3.md).
