At least for the GNU implementation of dc
, there is a hard-coded DEFAULT_LINE_MAX
of 70 characters - although that may be overridden by setting a DC_LINE_LENGTH
environment variable. From dc/numeric.c
:
559 static int out_col = 0;
560 static int line_max = -1; /* negative means "need to check environment" */
561 #define DEFAULT_LINE_MAX 70
562
563 static void
564 set_line_max_from_environment(void)
565 {
566 const char *env_line_len = getenv("DC_LINE_LENGTH");
567 line_max = DEFAULT_LINE_MAX;
568 errno = 0;
569 if (env_line_len) {
570 char *endptr;
571 long proposed_line_len = strtol(env_line_len, &endptr, 0);
572 line_max = (int)proposed_line_len;
573
574 /* silently enforce sanity */
575 while (isspace(*endptr))
576 ++endptr;
577 if (*endptr || errno || line_max != proposed_line_len
578 || line_max < 0 || line_max == 1)
579 line_max = DEFAULT_LINE_MAX;
580 }
581 }
582
So
$ dc
999999999999999999999999999999999999999999999999999999999999999999999999
p
999999999999999999999999999999999999999999999999999999999999999999999\
999
q
but
$ DC_LINE_LENGTH=0 dc
999999999999999999999999999999999999999999999999999999999999999999999999
p
999999999999999999999999999999999999999999999999999999999999999999999999
q
$