aboutsummaryrefslogtreecommitdiffstats
path: root/test/test-execl.sh
blob: 1a1c5809abfbfd094f85d7802a93bd2aa266812e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
cat > execl_test.c << EOF
#include <unistd.h>
int main() {
        return execl("/usr/bin/env", "/usr/bin/env", "A=A", "B=B", "C=C", NULL);
}
EOF

gcc -o execl_test execl_test.c

./execl_test | grep -q "C=C"

if [ "$?" = "0" ]
then
    #echo "Passed."
    rm -f execl_test execl_test.c
    exit 0
fi
#echo "Failed"
rm -f execl_test execl_test.c
exit 1