"Fossies" - the Fresh Open Source Software Archive

Member "tcsh-6.22.03/tests/variables.at" (18 Nov 2020, 14642 Bytes) of package /linux/misc/tcsh-6.22.03.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "variables.at": 6.22.02_vs_6.22.03.

    1 # Special shell variables
    2 
    3 # The space after $ is to avoid expanding the variables in testsuite output,
    4 # to work-around a bug in autotest
    5 
    6 # Not testing any functionality
    7 m4_define([VAR_UNSET],
    8 [AT_SETUP([$ $1])
    9 AT_CHECK([tcsh -f -c 'echo $?$1'], ,
   10 [0
   11 ])
   12 AT_CLEANUP
   13 ])
   14 m4_define([ENV_SET],
   15 [AT_SETUP([$ $1])
   16 AT_CHECK([tcsh -f -c 'printenv $1'], 0, [ignore])
   17 AT_CLEANUP
   18 ])
   19 m4_define([ENV_UNSET],
   20 [AT_SETUP([$ $1])
   21 AT_CHECK([tcsh -f -c 'printenv $1'], 1,
   22 [0
   23 ])
   24 AT_CLEANUP
   25 ])
   26 
   27 
   28 AT_SETUP([$ addsuffix])
   29 
   30 AT_CHECK([tcsh -f -c 'echo $?addsuffix'], ,
   31 [1
   32 ])
   33 # Nothing more
   34 
   35 AT_CLEANUP
   36 
   37 
   38 VAR_UNSET([afsuser])
   39 VAR_UNSET([ampm])
   40 
   41 
   42 AT_SETUP([$ anyerror])
   43 
   44 echo 'exit 1' > myfalse
   45 chmod +x myfalse
   46 
   47 AT_DATA([exit_status.csh],
   48 [[echo $?anyerror $anyerror
   49 ./myfalse | true ; echo $?
   50 unset anyerror ; echo $?anyerror
   51 ./myfalse | true ; echo $?
   52 set anyerror
   53 ./myfalse | true ; echo $?
   54 ]])
   55 
   56 AT_CHECK([tcsh -f exit_status.csh],,
   57 [1
   58 1
   59 0
   60 0
   61 1
   62 ])
   63 
   64 AT_CLEANUP
   65 
   66 
   67 AT_SETUP([$ argv])
   68 
   69 AT_CHECK([tcsh -f -c 'echo $argv; echo $2' foo bar baz], ,
   70 [foo bar baz
   71 bar
   72 ])
   73 
   74 AT_CLEANUP
   75 
   76 
   77 VAR_UNSET([autocorrect])
   78 VAR_UNSET([autoexpand])
   79 VAR_UNSET([autolist])
   80 TCSH_UNTESTED([$ autologout])
   81 
   82 
   83 AT_SETUP([$ backslash_quote])
   84 
   85 AT_DATA([backslash.csh],
   86 [[echo $?backslash_quote
   87 set echo_style=none
   88 echo 'foo\\bar'
   89 echo "foo\\bar"
   90 echo 'foo\bar'
   91 echo "foo\bar"
   92 set backslash_quote
   93 echo 'foo\\bar'
   94 echo "foo\\bar"
   95 echo 'foo\'bar'
   96 echo 'foo\"bar'
   97 echo "foo\"bar"
   98 echo "foo\'bar"
   99 echo 'foo\bar'
  100 echo "foo\bar"
  101 ]])
  102 AT_CHECK([tcsh -f backslash.csh], ,
  103 [0
  104 foo\\bar
  105 foo\\bar
  106 foo\bar
  107 foo\bar
  108 foo\bar
  109 foo\bar
  110 foo'bar
  111 foo"bar
  112 foo"bar
  113 foo'bar
  114 foo\bar
  115 foo\bar
  116 ])
  117 
  118 AT_CLEANUP
  119 
  120 
  121 VAR_UNSET([catalog])
  122 
  123 
  124 AT_SETUP([$ cdpath])
  125 
  126 AT_DATA([cdpath.csh],
  127 [[echo $?cdpath
  128 set cdpath=($cwd /)
  129 set home=$cwd
  130 mkdir tcsh_test_dir
  131 cd dev
  132 cd tcsh_test_dir
  133 ]])
  134 AT_CHECK([tcsh -f cdpath.csh], ,
  135 [0
  136 /dev @&t@
  137 ~/tcsh_test_dir @&t@
  138 ])
  139 
  140 AT_CLEANUP
  141 
  142 
  143 VAR_UNSET([color])
  144 VAR_UNSET([colorcat])
  145 
  146 
  147 AT_SETUP([$ command])
  148 
  149 AT_CHECK([tcsh -f -c 'echo $command'], ,
  150 [echo $command
  151 ])
  152 
  153 AT_DATA([command.csh],
  154 [[echo $?command
  155 ]])
  156 AT_CHECK([tcsh -f command.csh], ,
  157 [0
  158 ])
  159 
  160 AT_CLEANUP
  161 
  162 
  163 VAR_UNSET([complete])
  164 VAR_UNSET([continue])
  165 VAR_UNSET([continue_args])
  166 VAR_UNSET([correct])
  167 
  168 
  169 AT_SETUP([$ csubstnonl])
  170 
  171 touch test_file
  172 
  173 AT_DATA([csubstnonl.csh],
  174 [[echo $?csubstnonl
  175 echo `echo fail \
  176 | sed 's/fail/OK/'`
  177 sh -c 'echo 1 >&2'
  178 (echo `echo fail | \\
  179 sed 's/fail/OK/'`)
  180 sh -c 'echo 2 >&2'
  181 echo `echo a\
  182 b`
  183 unset csubstnonl
  184 sh -c 'echo 3 >&2'
  185 (echo `echo fail \
  186 | sed 's/fail/OK/'`)
  187 sh -c 'echo 4 >&2'
  188 echo `echo fail | \\
  189 sed 's/fail/OK/'`
  190 echo `echo \\
  191 ?est_file`
  192 echo `cat << END\
  193 OK\
  194 END`
  195 ]])
  196 AT_CHECK([tcsh -f csubstnonl.csh], ,
  197 [1
  198 OK
  199 
  200 a b
  201 fail
  202 OK
  203 test_file
  204 OK
  205 ],
  206 [1
  207  sed: Command not found.
  208 2
  209 3
  210 Invalid null command.
  211 4
  212 ])
  213 
  214 AT_CLEANUP
  215 
  216 
  217 AT_SETUP([$ cwd])
  218 
  219 AT_DATA([cwd.csh],
  220 [[echo $?cwd
  221 printenv PWD
  222 cd /
  223 echo $cwd
  224 pushd /dev
  225 echo $cwd
  226 popd
  227 echo $cwd
  228 printenv PWD
  229 setenv PWD foo
  230 echo $cwd
  231 set cwd=bar
  232 printenv PWD
  233 ]])
  234 AT_CHECK([tcsh -f cwd.csh | sed "s,$PWD,CWD,"], ,
  235 [1
  236 CWD
  237 /
  238 /dev / @&t@
  239 /dev
  240 / @&t@
  241 /
  242 /
  243 /
  244 foo
  245 ])
  246 
  247 AT_CLEANUP
  248 
  249 
  250 VAR_UNSET([dextract]) # Behavior tested with pushd
  251 VAR_UNSET([dirsfile])
  252 
  253 
  254 AT_SETUP([$ dirstack])
  255 
  256 AT_DATA([dirstack.csh],
  257 [[echo $dirstack
  258 set home=$cwd
  259 pushd /
  260 echo $dirstack
  261 set dirstack=(/ /dev $home)
  262 # The first popd does nothing, looks like a bug
  263 popd
  264 popd
  265 echo $dirstack
  266 ]])
  267 AT_CHECK([tcsh -f dirstack.csh | sed "s,$PWD,CWD,g"], ,
  268 [CWD
  269 / ~ @&t@
  270 / CWD
  271 / /dev ~ @&t@
  272 /dev ~ @&t@
  273 /dev CWD
  274 ])
  275 
  276 AT_CLEANUP
  277 
  278 
  279 TCSH_UNTESTED([$ dspmbyte])
  280 VAR_UNSET([dunique]) # Behavior tested with pushd
  281 
  282 
  283 AT_SETUP([$ echo])
  284 
  285 touch some_file;
  286 
  287 AT_CHECK([tcsh -f -c 'echo $?echo'], ,
  288 [0
  289 ])
  290 
  291 AT_CHECK([tcsh -f -x -c 'echo $?echo'], ,
  292 [1
  293 ],
  294 [echo 1
  295 ])
  296 
  297 AT_DATA([echo.csh],
  298 [[ls some_*
  299 set echo
  300 ls some_* $echo
  301 echo some_* $echo
  302 ]])
  303 AT_CHECK([tcsh -f echo.csh], ,
  304 [some_file
  305 some_file
  306 some_file
  307 ],
  308 [ls some_file
  309 echo some_*
  310 ])
  311 
  312 AT_CLEANUP
  313 
  314 
  315 AT_SETUP([$ echo_style])
  316 
  317 AT_DATA([echo_style.csh],
  318 [[echo $?echo_style
  319 set echo_style=bsd
  320 echo -n foo
  321 echo 'b\tr'
  322 set echo_style=sysv
  323 echo -n foo
  324 echo 'b\tr'
  325 set echo_style=both
  326 echo -n foo
  327 echo 'b\tr'
  328 set echo_style=none
  329 echo -n foo
  330 echo 'b\tr'
  331 ]])
  332 AT_CHECK([tcsh -f echo_style.csh], ,
  333 [1
  334 foob\tr
  335 -n foo
  336 b	r
  337 foob	r
  338 -n foo
  339 b\tr
  340 ])
  341 
  342 AT_CLEANUP
  343 
  344 
  345 AT_SETUP([$ edit])
  346 
  347 AT_CHECK([if [ ! -t 0 ]; then exit 77; fi],, [Skipping $edit tests])
  348 
  349 AT_CHECK([TERM=something tcsh -f -c 'echo $?edit'], ,
  350 [1
  351 ])
  352 
  353 AT_CHECK([TERM=dumb tcsh -f -c 'echo $?edit'], ,
  354 [0
  355 ])
  356 
  357 AT_CLEANUP
  358 
  359 
  360 AT_SETUP([$ ellipsis])
  361 
  362 AT_DATA([ellipsis0.csh],
  363 [[echo $?ellipsis
  364 set home=$cwd
  365 mkdir -p a/b
  366 cd a/b
  367 set prompt='%c01 '
  368 ]])
  369 AT_CHECK([tcsh -f -i -q < ellipsis0.csh], ,
  370 [> 0
  371 ~/<1>b exit
  372 ])
  373 
  374 AT_DATA([ellipsis0.csh],
  375 [[set ellipsis
  376 set home=$cwd
  377 mkdir -p a/b
  378 cd a/b
  379 set prompt='%c01 '
  380 ]])
  381 AT_CHECK([tcsh -f -i -q < ellipsis0.csh], ,
  382 [> ~...b exit
  383 ])
  384 
  385 AT_CLEANUP
  386 
  387 
  388 VAR_UNSET([fignore])
  389 VAR_UNSET([filec])
  390 
  391 
  392 AT_SETUP([$ gid])
  393 
  394 AT_CHECK([(tcsh -f -c 'echo $gid'; id -gr) | uniq | wc -l | tr -d ' \t'], ,
  395 [1
  396 ])
  397 
  398 AT_CLEANUP
  399 
  400 
  401 AT_SETUP([$ group])
  402 
  403 AT_DATA([group.csh],
  404 [[echo $?group
  405 set group=foo
  406 printenv GROUP
  407 setenv GROUP bar
  408 echo $group
  409 ]])
  410 AT_CHECK([tcsh -f group.csh], ,
  411 [1
  412 foo
  413 bar
  414 ])
  415 
  416 AT_CLEANUP
  417 
  418 
  419 AT_SETUP([$ histchars])
  420 
  421 AT_DATA([histchars.csh],
  422 [[echo $?histchars
  423 set histchars='/+'
  424 echo OK
  425 /3
  426 +K+k
  427 ]])
  428 AT_CHECK([tcsh -f -q -i < histchars.csh], ,
  429 [> 0
  430 OK
  431 OK
  432 Ok
  433 > exit
  434 ],
  435 [echo OK
  436 echo Ok
  437 ])
  438 
  439 AT_CLEANUP
  440 
  441 
  442 AT_SETUP([$ histdup])
  443 
  444 AT_DATA([histdup.csh],
  445 [[echo $?histdup
  446 history -c
  447 : 1
  448 : 2
  449 : 1
  450 history
  451 set histdup=all
  452 history -c
  453 : 1
  454 : 2
  455 : 1
  456 history
  457 set histdup=prev
  458 history -c
  459 : 1
  460 : 2
  461 : 1
  462 : 3
  463 : 3
  464 history
  465 set histdup=erase
  466 history -c
  467 : 1
  468 : 2
  469 : 1
  470 history
  471 ]])
  472 AT_CHECK([[tcsh -f -q -i < histdup.csh] dnl
  473 	   [| sed 's/	[^	]*	/ TIME /']], ,
  474 [> 0
  475      3 TIME : 1
  476      4 TIME : 2
  477      5 TIME : 1
  478      6 TIME history
  479      9 TIME : 1
  480     10 TIME : 2
  481     11 TIME history
  482     14 TIME : 1
  483     15 TIME : 2
  484     16 TIME : 1
  485     17 TIME : 3
  486     18 TIME history
  487     22 TIME : 2
  488     23 TIME : 1
  489     24 TIME history
  490 > exit
  491 ])
  492 
  493 AT_CLEANUP
  494 
  495 
  496 VAR_UNSET([histfile])
  497 
  498 
  499 AT_SETUP([$ histlit])
  500 
  501 AT_DATA([histlit.csh],
  502 [[echo $?histlit
  503 echo OK
  504 !!
  505 history
  506 history -S hist1
  507 set histlit
  508 history
  509 history -S hist2
  510 ]])
  511 AT_CHECK([[tcsh -f -q -i < histlit.csh] dnl
  512 	   [| sed 's/	[^	]*	/ TIME /']], ,
  513 [> 0
  514 OK
  515 OK
  516      1 TIME echo $?histlit
  517      2 TIME echo OK
  518      3 TIME echo OK
  519      4 TIME history
  520      1 TIME echo $?histlit
  521      2 TIME echo OK
  522      3 TIME !!
  523      4 TIME history
  524      5 TIME history -S hist1
  525      6 TIME set histlit
  526      7 TIME history
  527 > exit
  528 ],
  529 [echo OK
  530 ])
  531 AT_CHECK([[sed 's/^#+[0123456789]*$/#+STAMP/' < hist1]], ,
  532 [#+STAMP
  533 echo $?histlit
  534 #+STAMP
  535 echo OK
  536 #+STAMP
  537 echo OK
  538 #+STAMP
  539 history
  540 #+STAMP
  541 history -S hist1
  542 ])
  543 AT_CHECK([[sed 's/^#+[0123456789]*$/#+STAMP/' < hist2]], ,
  544 [#+STAMP
  545 echo $?histlit
  546 #+STAMP
  547 echo OK
  548 #+STAMP
  549 !!
  550 #+STAMP
  551 history
  552 #+STAMP
  553 history -S hist1
  554 #+STAMP
  555 set histlit
  556 #+STAMP
  557 history
  558 #+STAMP
  559 history -S hist2
  560 ])
  561 
  562 AT_CLEANUP
  563 
  564 
  565 AT_SETUP([$ history])
  566 
  567 AT_DATA([history.csh],
  568 [[echo $#history $history
  569 set home=$cwd
  570 set var=value
  571 set history=(1 '%/,%~,%h,%\!,\!,%%,%j,%$var,%#,%R\n')
  572 : OK
  573 history
  574 ]])
  575 AT_CHECK([tcsh -f -i -q < history.csh | sed "s,$PWD,CWD,"], ,
  576 [> 1 100
  577 CWD,~,     6,     6,     6,%,0,value,>,history
  578 > exit
  579 ])
  580 
  581 AT_CLEANUP
  582 
  583 
  584 AT_SETUP([$ home])
  585 
  586 AT_DATA([home.csh],
  587 [[echo $?home
  588 (echo $home; echo ~) | uniq | wc -l | tr -d ' \t'
  589 set home=/foo
  590 printenv HOME
  591 setenv HOME /bar
  592 echo $home
  593 ]])
  594 AT_CHECK([
  595 case "$(uname -s)" in
  596 Darwin)
  597     HOME=$(dscl . read "/Users/$USER" NFSHomeDirectory | awk '{ print $NF }')
  598     ;;
  599 *)
  600     HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }')
  601     ;;
  602 esac;
  603 export HOME;
  604 tcsh -f home.csh
  605 ], ,
  606 [1
  607 1
  608 /foo
  609 /bar
  610 ])
  611 
  612 AT_CHECK([(unset HOME; tcsh -f -c 'echo $?home; printenv HOME')], 1,
  613 [0
  614 ])
  615 
  616 AT_CLEANUP
  617 
  618 
  619 VAR_UNSET([ignoreeof])
  620 
  621 
  622 AT_SETUP([$ implicitcd])
  623 
  624 AT_DATA([implicitcd.csh],
  625 [[echo $?implicitcd
  626 mkdir subdir
  627 set home=$cwd
  628 sh -c 'echo 1 >&2'
  629 (subdir)
  630 sh -c 'echo 2 >&2'
  631 (~/subdir)
  632 sh -c 'echo 3 >&2'
  633 set implicitcd
  634 subdir
  635 /bin/pwd
  636 ..
  637 ~/subdir
  638 /bin/pwd
  639 cd
  640 set implicitcd=verbose
  641 subdir
  642 ..
  643 ~/subdir
  644 ]])
  645 (echo 1; echo 'subdir: Command not found.';
  646  echo 2; echo "$PWD/subdir: Permission denied."; echo 3) > experr
  647 AT_CHECK([tcsh -f -i -q < implicitcd.csh | sed "s,`/bin/pwd`,CWD,"], ,
  648 [> 0
  649 CWD/subdir
  650 CWD/subdir
  651 cd subdir
  652 cd ..
  653 cd ~/subdir
  654 > exit
  655 ], [experr])
  656 
  657 AT_CLEANUP
  658 
  659 
  660 VAR_UNSET([inputmode])
  661 VAR_UNSET([killdup])
  662 
  663 
  664 AT_SETUP([$ killring])
  665 
  666 AT_CHECK([tcsh -f -c 'echo $killring'], ,
  667 [30
  668 ])
  669 # Nothing more
  670 
  671 AT_CLEANUP
  672 
  673 
  674 AT_SETUP([$ listflags])
  675 
  676 # First word checked with ls-F
  677 AT_DATA([listflags.csh],
  678 [[echo $?listflags
  679 set listflags=(-xA $cwd/args.sh)
  680 ls-F -something .
  681 ]])
  682 AT_DATA([args.sh],
  683 [[echo "$@"
  684 ]])
  685 chmod a+x args.sh
  686 AT_CHECK([tcsh -f listflags.csh], ,
  687 [0
  688 -xFA -something .
  689 ])
  690 
  691 AT_CLEANUP
  692 
  693 
  694 VAR_UNSET([listjobs])
  695 VAR_UNSET([listlinks]) # Functionality tested with ls-F
  696 VAR_UNSET([listmax])
  697 VAR_UNSET([listmaxrows])
  698 VAR_UNSET([loginsh]) # Can't test the other case
  699 VAR_UNSET([logout])
  700 
  701 
  702 AT_SETUP([$ mail])
  703 
  704 AT_DATA([mail.csh],
  705 [[echo $?mail
  706 mkdir maildir
  707 touch spool
  708 set mail=(0 spool maildir)
  709 echo > maildir/1
  710 echo > maildir/2
  711 echo >> spool
  712 echo >> spool
  713 ]])
  714 AT_CHECK([tcsh -f mail.csh], ,
  715 [0
  716 ])
  717 
  718 AT_CLEANUP
  719 
  720 
  721 AT_SETUP([$ cdtohome])
  722 AT_CHECK([
  723 case "$(uname -s)" in
  724 Darwin)
  725     HOME=$(dscl . read "/Users/$USER" NFSHomeDirectory | awk '{ print $NF }')
  726     ;;
  727 *)
  728     HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }')
  729     ;;
  730 esac;
  731 export HOME;
  732 tcsh -f -c 'cd'
  733 ], 0)
  734 AT_CLEANUP
  735 AT_SETUP([$ noimplicithome])
  736 AT_CHECK([tcsh -f -c 'unset cdtohome; cd'], 1, , [cd: Too few arguments.
  737 ])
  738 AT_CLEANUP
  739 
  740 
  741 VAR_UNSET([matchbeep])
  742 VAR_UNSET([nobeep])
  743 VAR_UNSET([noclobber]) # Functionality tested with "Command execution"
  744 VAR_UNSET([noding])
  745 # Functionality tested with "Filename substitution" and
  746 # "Directory stack substitution"
  747 VAR_UNSET([noglob])
  748 VAR_UNSET([nostat])
  749 VAR_UNSET([notify])
  750 TCSH_UNTESTED([$ oid])
  751 
  752 
  753 AT_SETUP([$ owd])
  754 
  755 AT_DATA([owd.csh],
  756 [[echo $owd
  757 cd /
  758 echo $owd
  759 pushd /bin
  760 echo $owd
  761 popd
  762 echo $owd
  763 ]])
  764 AT_CHECK([tcsh -f owd.csh | sed "s,$PWD,CWD,"], ,
  765 [
  766 CWD
  767 /bin / @&t@
  768 /
  769 / @&t@
  770 /bin
  771 ])
  772 
  773 AT_CLEANUP
  774 
  775 
  776 AT_SETUP([$ path])
  777 
  778 mkdir subdir
  779 AT_DATA([script.sh],
  780 [[echo home
  781 ]])
  782 AT_DATA([subdir/script.sh],
  783 [[echo subdir
  784 ]])
  785 chmod a+x script.sh subdir/script.sh
  786 AT_DATA([path.csh],
  787 [[echo $?path
  788 set path=(. subdir)
  789 script.sh
  790 set path=(subdir .)
  791 script.sh
  792 printenv PATH
  793 setenv PATH :foo::bar:
  794 echo $path
  795 ]])
  796 AT_CHECK([tcsh -f path.csh], ,
  797 [1
  798 home
  799 subdir
  800 subdir:.
  801 . foo . bar .
  802 ])
  803 
  804 AT_CLEANUP
  805 
  806 
  807 AT_SETUP([$ printexitvalue])
  808 
  809 echo 'exit 1' > myfalse
  810 chmod +x myfalse
  811 
  812 AT_DATA([printexitvalue.csh],
  813 [[echo $?printexitvalue
  814 set printexitvalue
  815 ./myfalse
  816 (exit 3 >/dev/null)
  817 :
  818 ]])
  819 AT_CHECK([tcsh -f printexitvalue.csh], ,
  820 [0
  821 Exit 1
  822 Exit 3
  823 ])
  824 
  825 AT_CLEANUP
  826 
  827 
  828 AT_SETUP([$ prompt])
  829 
  830 AT_DATA([prompt.csh],
  831 [[echo "$prompt"
  832 set home=$cwd
  833 mkdir -p a/b
  834 cd a/b
  835 set var=value
  836 set prompt='%/,%~,%c,%.,%c2,%.2,%c01,%.01,%C,%h,%\!,\!,%%,%j,%$var,%#,%? '
  837 (exit 50)
  838 ]])
  839 AT_CHECK([tcsh -f -i -q < prompt.csh | sed "s,$PWD,CWD,"], ,
  840 [> %# @&t@
  841 CWD/a/b,~/a/b,b,b,~/a/b,~/a/b,~/<1>b,~/<1>b,b,8,8,8,%,0,value,>,50 exit
  842 ])
  843 
  844 AT_CLEANUP
  845 
  846 
  847 AT_SETUP([$ prompt2])
  848 
  849 AT_CHECK([echo 'echo "$prompt2"' | tcsh -f], ,
  850 [%R? @&t@
  851 ])
  852 
  853 AT_CLEANUP
  854 
  855 
  856 AT_SETUP([$ prompt3])
  857 
  858 AT_CHECK([echo 'echo "$prompt3"' | tcsh -f], ,
  859 [CORRECT>%R (y|n|e|a)? @&t@
  860 ])
  861 
  862 AT_CLEANUP
  863 
  864 AT_SETUP([$ promptchars])
  865 
  866 AT_DATA([promptchars.csh],
  867 [[echo $?promptchars
  868 set promptchars=_x
  869 ]])
  870 AT_CHECK([tcsh -f  -i -q < promptchars.csh], ,
  871 [> 0
  872 _ exit
  873 ])
  874 
  875 AT_CLEANUP
  876 
  877 
  878 VAR_UNSET([pushdtohome]) # Functionality tested with pushd
  879 VAR_UNSET([pushdsilent]) # Functionality tested with pushd
  880 VAR_UNSET([recexact])
  881 VAR_UNSET([recognize_only_executablers])
  882 VAR_UNSET([rmstar])
  883 
  884 
  885 AT_SETUP([$ rprompt])
  886 
  887 AT_DATA([rprompt.csh],
  888 [[echo $?rprompt
  889 set home=$cwd
  890 mkdir -p a/b
  891 cd a/b
  892 set var=value
  893 set rprompt='%/,%~,%c,%.,%c2,%.2,%c01,%.01,%C,%h,%\!,\!,%%,%j,%$var,%#,%?'
  894 (exit 50)
  895 ]])
  896 AT_CHECK([tcsh -f -i -q < rprompt.csh | sed "s,$PWD,CWD,"], ,
  897 [> 0
  898 > CWD/a/b,~/a/b,b,b,~/a/b,~/a/b,~/<1>b,~/<1>b,b,8,8,8,%,0,value,>,50 exit
  899 ])
  900 
  901 AT_CLEANUP
  902 
  903 
  904 VAR_UNSET([savedirs])
  905 VAR_UNSET([savehist])
  906 VAR_UNSET([sched])
  907 
  908 
  909 AT_SETUP([$ shell])
  910 
  911 AT_CHECK([tcsh -f -c 'echo $?shell'], ,
  912 [1
  913 ])
  914 
  915 AT_CHECK([SHELL=foo/tcsh tcsh -f -c 'echo $shell'], ,
  916 [foo/tcsh
  917 ])
  918 
  919 AT_CLEANUP
  920 
  921 
  922 AT_SETUP([$ shlvl])
  923 
  924 AT_DATA([shlvl.csh],
  925 [[echo $shlvl
  926 set shlvl=8
  927 printenv SHLVL
  928 setenv SHLVL 2
  929 echo $shlvl
  930 tcsh -f -c 'echo $shlvl'
  931 tcsh -f -c 'tcsh -f -c "printenv SHLVL"'
  932 tcsh -f -c 'exec tcsh -f -c "printenv SHLVL"'
  933 tcsh -f -c '(exec tcsh -f -c "printenv SHLVL")'
  934 ]])
  935 AT_CHECK([SHLVL=5 tcsh -f shlvl.csh], ,
  936 [6
  937 8
  938 2
  939 3
  940 4
  941 3
  942 4
  943 ])
  944 
  945 AT_CLEANUP
  946 
  947 
  948 AT_SETUP([$ status])
  949 
  950 AT_DATA([status.csh],
  951 [[echo $status
  952 sh -c 'kill -ABRT $$'
  953 if ( $status > 128 ) echo OK
  954 true
  955 echo $status
  956 ]])
  957 AT_CHECK([tcsh -f status.csh 2>&1 | sed 's/Abort (core dumped)/Abort/'], ,
  958 [0
  959 Abort
  960 OK
  961 0
  962 ])
  963 
  964 AT_CLEANUP
  965 
  966 
  967 AT_SETUP([$ symlinks])
  968 
  969 AT_DATA([symlinks.csh],
  970 [[echo $?symlinks
  971 set home=$cwd
  972 mkdir -p a/b
  973 ln -s a/b link
  974 set symlinks=chase
  975 cd link
  976 echo $cwd
  977 cd
  978 set symlinks=ignore
  979 cd link
  980 echo $cwd
  981 cd ..
  982 echo $cwd
  983 set symlinks=expand
  984 cd a
  985 (echo ../a; echo $cwd) | uniq | wc -l | tr -d ' \t'
  986 ]])
  987 AT_CHECK([tcsh -f symlinks.csh | sed "s,`tcsh -f -c echo\\ \\$PWD`,CWD,"], ,
  988 [0
  989 CWD/a/b
  990 CWD/link
  991 CWD
  992 1
  993 ])
  994 
  995 AT_CLEANUP
  996 
  997 
  998 AT_SETUP([$ tcsh])
  999 
 1000 AT_CHECK([tcsh -f -c 'echo $?tcsh'], ,
 1001 [1
 1002 ])
 1003 
 1004 AT_CLEANUP
 1005 
 1006 
 1007 AT_SETUP([$ term])
 1008 
 1009 AT_DATA([term.csh],
 1010 [[echo $term
 1011 set term=foo
 1012 printenv TERM
 1013 setenv TERM bar
 1014 echo $term
 1015 ]])
 1016 AT_CHECK([TERM=something tcsh -f term.csh], ,
 1017 [something
 1018 foo
 1019 bar
 1020 ])
 1021 
 1022 AT_CHECK([(unset TERM; tcsh -f -c 'echo $?term; printenv TERM')], 1,
 1023 [0
 1024 ])
 1025 
 1026 AT_CLEANUP
 1027 
 1028 
 1029 VAR_UNSET([time])
 1030 VAR_UNSET([tperiod])
 1031 
 1032 
 1033 AT_SETUP([$ tty])
 1034 
 1035 AT_CHECK([tcsh -f -c 'echo ">$tty<"' < /dev/null], ,
 1036 [><
 1037 ])
 1038 
 1039 AT_CLEANUP
 1040 
 1041 
 1042 AT_SETUP([$ uid])
 1043 
 1044 AT_CHECK([(tcsh -f -c 'echo $uid'; id -ru) | uniq | wc -l | tr -d ' \t'], ,
 1045 [1
 1046 ])
 1047 
 1048 AT_CLEANUP
 1049 
 1050 
 1051 AT_SETUP([$ user])
 1052 
 1053 AT_DATA([user.csh],
 1054 [[echo $?user
 1055 set user=foo
 1056 printenv USER
 1057 setenv USER bar
 1058 echo $user
 1059 ]])
 1060 AT_CHECK([tcsh -f user.csh], ,
 1061 [1
 1062 foo
 1063 bar
 1064 ])
 1065 
 1066 AT_CHECK([(unset USER; LOGNAME=foo tcsh -f -c 'echo $user; printenv USER')], ,
 1067 [foo
 1068 foo
 1069 ])
 1070 
 1071 AT_CHECK([(unset LOGNAME; USER=foo tcsh -f -c 'echo $user; printenv LOGNAME')],
 1072  ,
 1073 [foo
 1074 foo
 1075 ])
 1076 
 1077 AT_CLEANUP
 1078 
 1079 
 1080 AT_SETUP([$ verbose])
 1081 
 1082 AT_CHECK([tcsh -f -v -c 'echo $verbose'], , [
 1083 ],
 1084 [echo $verbose
 1085 ])
 1086 
 1087 AT_DATA([verbose.csh],
 1088 [[echo $?verbose
 1089 set verbose
 1090 echo $verbose
 1091 !!
 1092 ]])
 1093 AT_CHECK([tcsh -f -i -q < verbose.csh], ,
 1094 [> 0
 1095 
 1096 
 1097 > exit
 1098 ],
 1099 [echo $verbose
 1100 echo $verbose
 1101 ])
 1102 
 1103 AT_CLEANUP
 1104 
 1105 
 1106 AT_SETUP([$ version])
 1107 
 1108 AT_CHECK([tcsh -f -c 'echo $?version'], ,
 1109 [1
 1110 ])
 1111 
 1112 AT_CLEANUP
 1113 
 1114 
 1115 VAR_UNSET([visiblebell])
 1116 VAR_UNSET([watch])
 1117 VAR_UNSET([who])
 1118 VAR_UNSET([wordchars])
 1119 
 1120 
 1121 # Nothing to test for environment variables, except for the synchronization
 1122 # above