Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

spreadsheet calculator sc is a very old console-based program. It does what the name says. I cannot find how to undo an operation in its man page. I currently use it together with RCS, ie. manually create versions in RCS before big changes, and rotate back to a version if needed. I am wondering if there is a better way to do it. Thanks.

share|improve this question
seems nobody uses it anymore... – Jing Nov 10 '12 at 23:53
I've just downloaded sc and am familiarising myself with it. AFAICT there is no undo at all. :( I've seen it on some todo lists. – Sparhawk Aug 2 '13 at 3:46
FWIW I just tried giving teapot a go, and this also seems to lack undo. – Sparhawk Aug 2 '13 at 4:27
up vote 0 down vote accepted

This may be false hope, but undo seems to be possible with the 7.16 RPM source from Fedora, likely the Debian packages sources, with the Yank and Pull features, and some strategic tweaks.

For example, the = command, in sc.c, line 1140, one line change,

            case '=':
                if (locked_cell(currow, curcol))
                /* set mark 0 */
                savedrow[27] = currow;
                savedcol[27] = curcol;
                savedstrow[27] = strow;
                savedstcol[27] = stcol;

                /* btiffin, yank current cell to buffer 0 */
                yankr(lookat(currow, curcol), lookat(currow, curcol));

                (void) sprintf(line,"let %s = ", v_name(currow, curcol));
                linelim = strlen(line);

The call to yankr places the current cell contents in the '0' buffer, as would say the 'x' command, or 'yy'. So if a mistake is made, at least simple entries, 'pp' will put the old cell contents back in place.

This may be wrong headed, but it worked the charm here. Next up is yankr with range operations. From a quick glance, there should be no more the 50 or so strategic calls to yankr(start, end) to have the Pull commands to fall back on when mistakes are made. At least to one level.

First four experiments succeeded,


and already the 'on edge' sensations when using sc are much diminished. Use case is not simply for the spreadsheet, but driving the spreadsheet from external scripts and setting/getting cell values with simple popen calls, in COBOL by the way, GnuCOBOL.

Note, this is just today. Could discover the fatally borked wrong headedness, of what seems to be a simple fix, tomorrow. Hmmm, now pondering, reading this over before hitting Post, it may not be buffer '0', ... more reading of source codes, clicking Post anyway.

share|improve this answer

I am working on a terminal spreadsheet based on "sc". It has undo/redo, mapping and other stuff. If interested, you can take a look at: https://github.com/andmarti1424/scim

share|improve this answer

The Debian package knows of Undo (keybinding u, see also this manpage), so maybe you can grab their source package and compile it on your system.

share|improve this answer
As far as I understand it, that is for undoing the editing when you input in the top line, not for undoing an operation. – Jing Nov 7 '12 at 18:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.