File: no-nl-command.sh

package info (click to toggle)
clitest 0.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 484 kB
  • sloc: sh: 1,570; makefile: 4
file content (25 lines) | stat: -rw-r--r-- 464 bytes parent folder | download | duplicates (3)
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
# All results assume a trailing newline (\n) at the last line.
# Outputs with no \n at the end cannot be tested directly.

$ printf 'ok\n'
ok
$ printf 'fail'
fail
$ printf 'ok\nok\nfail'
ok
ok
fail
$

# The same applies for inline output.

$ printf 'ok\n'    #=> ok
$ printf 'fail'    #=> fail

# An easy workaround is to add an empty 'echo' at the end:

$ printf 'ok'; echo   #=> ok

# Another workaround is to use --regex

$ printf 'ok'         #=> --regex ^ok$