Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Display file with escaped color codes Post 302648375 by Corona688 on Tuesday 29th of May 2012 06:19:20 PM
Old 05-29-2012
Oh, the character ^[ was literally the characters ^ and [ ? That's just how many programs display it when it is a 033, didn't think it needed conversion. Sorry!
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to have color coded Terminal display,(like linux)

Hi all, I would like to know how to have a color display in the terminal... In the sense that, In many linux terminals,we have color coded for each file type, green for executable ,blue for dirs and so on... I wanted to know how i can have the same arrangement in solaris(b-79a) I am not... (5 Replies)
Discussion started by: wrapster
5 Replies

2. UNIX for Dummies Questions & Answers

Using color escape codes in less

Hi all, Not sure how "for dummies" this question is, but I'd better use understatement... A. My Environment ============== I am using RedHat Linux, version 2.6.18-53.el5. When I type less --version I get: less 394 Copyright (C) 1984-2005 Mark Nudelman ... My terminal is configured... (1 Reply)
Discussion started by: Source2Exe
1 Replies

3. UNIX for Dummies Questions & Answers

Regular expression on hex color codes

I want to have all hex color codes in a given stylesheet in uppercase, so #fff should be converted to #FFF for instance. Here is the regular expression I use to match and convert hex color codes to uppercase: sed -e 's/^#({3}$)|({6}$)/^#({3}$)|({6}$)/' main.css However, no conversion to uppercase... (6 Replies)
Discussion started by: figaro
6 Replies

4. UNIX for Dummies Questions & Answers

Display Console errors in Red color

I browsed the forums but i couldn't find the best answer.so,i'm posting here again.. I have a parent bash script which calls another child script and the child script is used to deploy the tar file using weblogic deployer. The script is used to display the output on the console and sent to a log... (5 Replies)
Discussion started by: ramse8pc
5 Replies

5. Programming

Using ANSI color codes in gcc compiled program

I have put some yellow color codes and works well. I call the funstion using print_usage(stderr, 0); I would like to know if there is any way, to store the ansi color codes in variables and then call them inside fprintf. Or have a format followed by the strings I want to output. ... (5 Replies)
Discussion started by: kristinu
5 Replies

6. Shell Programming and Scripting

Help with awk color codes based on condition

HI i have two files say test and test1 Test.txt Code: Lun01 2TB 1.99TB 99.6% Lun02 2TB 1.99TB 99.5% Lun03 2TB 1.99TB 99.5% Lun04 2TB 1.55TB 89.6% Code: Test1.txt Lun01 2TB 1.99TB 89.5% Lun02 2TB 1.99TB 99.5% Lun03 2TB 1.99TB 99.5% Requirement is to compare... (6 Replies)
Discussion started by: venkitesh
6 Replies
MBSINIT(3)						     Linux Programmer's Manual							MBSINIT(3)

NAME
mbsinit - test for initial shift state SYNOPSIS
#include <wchar.h> int mbsinit(const mbstate_t *ps); DESCRIPTION
Character conversion between the multibyte representation and the wide character representation uses conversion state, of type mbstate_t. Conversion of a string uses a finite-state machine; when it is interrupted after the complete conversion of a number of characters, it may need to save a state for processing the remaining characters. Such a conversion state is needed for the sake of encodings such as ISO-2022 and UTF-7. The initial state is the state at the beginning of conversion of a string. There are two kinds of state: The one used by multibyte to wide character conversion functions, such as mbsrtowcs(3), and the one used by wide character to multibyte conversion functions, such as wcsr- tombs(3), but they both fit in a mbstate_t, and they both have the same representation for an initial state. For 8-bit encodings, all states are equivalent to the initial state. For multibyte encodings like UTF-8, EUC-*, BIG5 or SJIS, the wide character to multibyte conversion functions never produce non-initial states, but the multibyte to wide-character conversion functions like mbrtowc(3) do produce non-initial states when interrupted in the middle of a character. One possible way to create an mbstate_t in initial state is to set it to zero: mbstate_t state; memset(&state,0,sizeof(mbstate_t)); On Linux, the following works as well, but might generate compiler warnings: mbstate_t state = { 0 }; The function mbsinit() tests whether *ps corresponds to an initial state. RETURN VALUE
mbsinit() returns nonzero if *ps is an initial state, or if ps is a NULL pointer. Otherwise it returns 0. CONFORMING TO
C99. NOTES
The behavior of mbsinit() depends on the LC_CTYPE category of the current locale. SEE ALSO
mbsrtowcs(3), wcsrtombs(3) COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2000-11-20 MBSINIT(3)
All times are GMT -4. The time now is 03:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy