When truss is displaying a string, it will display the character if it is printable and it puts a space between the letters. If the character is not printable is outputs in hex and in this case it will need two positions, so you lose the space.
1B is an escape character. You can see it (maybe) with "man ascii". Octal is a little more common in the unix world. You can convert hex to octal via bc. Quick example:
echo "obase=8;ibase=16;1B" | bc
Those are usually called escape sequences. Once you know that an escape is 33 in octal, you can model this in ksh:
The sleep will delay the printing of your prompt long enough to see what happened. The first and last escape sequences are mysteries to me. The second moves the cursor. The third is an sgr (select graphic rendition) The 1 goes to bold mode. I have no idea what the 31 is supposed to do. It is a nop with my xterm. And this leaves my terminal in bold mode. I had to do a "tput sgr0" to fix it.
But if I was using hpterm instead of xterm, this would not work at all. That is the problem with this sort of thing, you must guess at the user's terminal.
Last edited by Yogesh Sawant; 05-26-2010 at 03:08 AM..
Reason: added code tags
Hi all
The makefile of a large project produces hundreds of lines of output, which I can't look at any more when the build is finished. If I simply redirect the output to a file, I can't see the progress of the building process...
Is there a possibility to redirect the output to a file and at... (1 Reply)
I have a window open on my ultra 10 - a terminal window connecting to a server.
Is there any way I can log all output to this window to a log file on my ultra 10 ? (2 Replies)
Hi all,
i type a command along with dtterm what i would like to have is that the output of the command to be shown in the new terminal .
Any Idea on how to acheive this? (0 Replies)
Hey,
How can I transfer the terminal output to a file ?
For example :
command "fuser" returns the "process-id" and prints the output on the terminal, but I want that output to a file as well. How can I do that ?
/clocal/mqbrkrs/user/mqsiadm/sanjay/AccessMonitor $ fuser -uf... (2 Replies)
Hi,
I'm trying to come up with a simple expect script that allows me to login to a system and run a single command ... something like this:
#!/usr/bin/expect -f
# let's set some variables
#set password
set ipaddr
set ponumber
set hostname
set timeout -1
# let's now connect to the... (0 Replies)
Hello
Using BASH under Ubuntu 10.4 lts + XMonad
My script is almost perfect but i'm stuck at the last hurdle:
I need a sort of modified 'echo' which truncates its output to the width of the terminal
I can find the terminal's width with 'stty size' but i dont know how to then convert input... (2 Replies)
When ever i started my terminal,Every time I have to change the directory like "cd user/documents/ravi/folder2/folder3" Without typing this entire command every time ,I placed "alias c='cd user/documents/ravi/folder2/folder3'" in .bash_profile file. so that i can able to execute command 'c'... (6 Replies)
i make a shell script. There has a line wget
https://cisofy.com/files/lynis-2.1.0-88394c1affb9e23bd7390098947b3fd4b04e35e8.tar.gzWhen this line execute terminal show some text like this
Resolving cisofy.com (cisofy.com)... 149.*.*.*
Connecting to cisofy.com (cisofy.com)|149.*.*.*|:4444...... (4 Replies)
How can I have all my output to a terminal pager by default.
I want all output to pause once screen is full.
Piping to more does not work if the app/script is interactive (2 Replies)
Hello All,
I have a text file containing output from a command that contains lots of escape/control characters that when viewed using vi or view, looks like jibberish. But when viewed using the cat command the output is formatted properly.
Is there any way to take the output from the cat... (7 Replies)
Discussion started by: mrm5102
7 Replies
LEARN ABOUT DEBIAN
resize
RESIZE(1) General Commands Manual RESIZE(1)NAME
resize - set environment and terminal settings to current xterm window size
SYNOPSIS
resize [ -u | -c ] [ -s [ row col ] ]
DESCRIPTION
Resize prints a shell command for setting the appropriate environment variables to indicate the current size of xterm window from which the
command is run. For this output to take effect, resize must either be evaluated as part of the command line (usually done with a shell
alias or function) or else redirected to a file which can then be read in. From the C shell (usually known as /bin/csh), the following
alias could be defined in the user's .cshrc:
% alias rs 'set noglob; eval `resize`'
After resizing the window, the user would type:
% rs
Users of versions of the Bourne shell (usually known as /bin/sh) that don't have command functions will need to send the output to a tempo-
rary file and then read it back in with the "." command:
$ resize > /tmp/out
$ . /tmp/out
Resize determines the user's current shell by first checking if $SHELL is set, and using that. Otherwise it determines the user's shell by
looking in the password file. Generally Bourne-shell variants (including ksh) do not modify $SHELL, so it is possible for resize to be
confused if one runs resize from a Bourne shell spawned from a C shell.
OPTIONS
The following options may be used with resize:
-u This option indicates that Bourne shell commands should be generated even if the user's current shell isn't /bin/sh.
-c This option indicates that C shell commands should be generated even if the user's current shell isn't /bin/csh.
-s [rows columns]
This option indicates that Sun console escape sequences will be used instead of the VT100-style xterm escape codes. If rows and
columns are given, resize will ask the xterm to resize itself. However, the window manager may choose to disallow the change.
Note that the Sun console escape sequences are recognized by XFree86 xterm and by dtterm. The resize program may be installed as sunsize,
which causes makes it assume the -s option.
The rows and columns arguments must appear last; though they are normally associated with the -s option, they are parsed separately.
FILES
/etc/termcap for the base termcap entry to modify.
~/.cshrc user's alias for the command.
ENVIRONMENT
TERM set to "xterm" if not already set.
TERMCAP variable set on systems using termcap
COLUMNS, LINES variables set on systems using terminfo
SEE ALSO csh(1), tset(1), xterm(1)AUTHORS
Mark Vandevoorde (MIT-Athena), Edward Moy (Berkeley)
Copyright (c) 1984, 1985 by X Consortium
See X(7) for a complete copyright notice.
X Window System RESIZE(1)