[go: up one dir, main page]

File: fixcat

package info (click to toggle)
dejagnu 1.3-8
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 6,980 kB
  • ctags: 2,855
  • sloc: ansic: 41,277; exp: 9,037; sh: 2,765; makefile: 2,431; lisp: 1,403; tcl: 1,242
file content (21 lines) | stat: -rwxr-xr-x 526 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!expect --
# Synopsis: fixcat
# Author: Don Libes

# Description: test to see if /bin/cat is unbuffered (i.e., -u is needed)
# Return 0 if buffered, 1 if unbuffered.
#
# If this file is sitting in an architecture-specific library directory,
# then it serves as a marker that your /bin/cat buffers by default.

# test for when catting to/from files
log_user 0
spawn -open [open "|cat" "r+"]
send "\r"
expect "\r" {exit 1}

# test for when catting to real tty
#log_user 0
#spawn /bin/cat
#send "\r"
#expect "\r\n\r\n" {exit 1}