This file is indexed.

/usr/bin/checkbashism_tap is in jenkins-debian-glue 0.18.4.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env ruby

if ARGV[0].nil?
  $stderr.puts "Usage: #{File.basename $0} <file>"
  exit 1
end

if not system "which checkbashisms >/dev/null 2>&1"
  $stderr.puts "Error: program checkbashisms does not exist (install devscripts package)."
  exit 1
end

file = ARGV[0]

if not File.exists? file
  $stderr.puts "Error: file #{file} could not be read."
  exit 1
end

# Make sure we're looking at sh code.
mimetype = `file -b -i #{file}`.gsub(/\n/,"")
if not /.*x-shellscript/i.match(mimetype)
  $stderr.puts "File #{file} doesn't look like sh code [#{mimetype}]. Ignoring."
  exit 0
end


output = %x{checkbashisms --posix #{file} 2>&1}

num_lines = output.lines.count / 2 # checkbasims has one line message and one line code
exit 0 if num_lines == 0 # nothing found, jey
counter = 1

if output =~ /does not appear to have a #! interpreter line/
  $stderr.puts "File #{file} does not appear to have a #! interpreter line, skipping."
  exit 0
end


# output result in TAP format
puts "1..#{num_lines}"
output.gsub(/:\n/, ':').each_line do |critic|
  next unless critic =~ /^possible bashism in/
  puts "not ok #{counter}           #{critic}"
  counter += 1
end