File: exitstatus.sh

package info (click to toggle)
littler 0.3.22-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 848 kB
  • sloc: ansic: 586; sh: 132; makefile: 5
file content (31 lines) | stat: -rwxr-xr-x 673 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash

echo "Testing value of 'q(status=...)' exits for r:"
echo "q(status=123)" | ../r  
echo "  Got: $? via stdin"

echo "q(status=124)" | ../r -
echo "  Got: $? via file '-'"

../r -e "q(status=125)" 
echo "  Got: $? from 'r -e'"

tempfile=`tempfile`
echo "q(status=126)" > $tempfile
../r $tempfile
echo -n "  Got: $? from temp. file and "
rm -v $tempfile


echo "Testing value of 'q(status=...)' exits for Rscript:"
echo "q(status=123)" | Rscript -
echo "  Got: $? via stdin"

Rscript -e "q(status=124)" 
echo "  Got: $? from 'r -e'"

tempfile=`tempfile`
echo "q(status=125)" > $tempfile
Rscript $tempfile
echo -n "  Got: $? from temp. file and "
rm -v $tempfile