Benign freebsd-ports Download

reversed-range-endpoints

Shell evaluates variable commandShell command redirects output to file
SHA-2566b5958724dc2eecdc96418beb946aabbc8d9f454b19ea8b0214821c6ebc0e671

Evidence

Moves files into out or target output lines 1–18
1#!/bin/sh
2# Ensure that an invalid range like [b-a] evokes exit status of 2.
3. "${srcdir=.}/init.sh"; path_prepend_ ../src
4
5fail=0
6
7printf 'grep: Invalid range end\n' > exp
8for prog in grep 'grep -E'; do
9 # exit status must be 2, not 1
10 returns_ 2 $prog '[b-a]' < /dev/null > out 2>&1 || fail=1
11
12 # Normalize the diagnostic prefix from e.g., "/mnt/dir/grep: " to "grep: "
13 sed 's/^[^:]*: /grep: /' out > k && mv k out
14
15 compare exp out || fail=1
16done
17
18Exit $fail

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.