Sponsored Content
Full Discussion: Print N characters in ksh
Top Forums Shell Programming and Scripting Print N characters in ksh Post 302467132 by iga3725 on Thursday 28th of October 2010 10:28:08 AM
Old 10-28-2010
Hi,

Do you know if it's possible to fill the output line with "*" taking into account the size of the windows you're looking?

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print the characters in a word

Hi, How can I split the characters in a word? For Eg: If my input is: command my output should be: c o m m a n d Please help me in doing it so. (5 Replies)
Discussion started by: chella
5 Replies

2. UNIX for Dummies Questions & Answers

Ksh Checking if string has 2 characters and does not contain digits?

How could I check if a string variable contains at least (or only) 2 characters, and check and make sure that the string does not contain any numeric digits?...I need to know how to do this as simple as possible. and I am using the Ksh shell. Thanks. (1 Reply)
Discussion started by: developncode
1 Replies

3. Shell Programming and Scripting

get last characters in ksh

Hi, Here the way the txt file looks like.. 100|abcd|6899|xyz 112|dlkja|79311| 432|adjkl|1348|iaw I need the last characters after the last '|' .. thanks (5 Replies)
Discussion started by: meghana
5 Replies

4. Shell Programming and Scripting

print 10 characters in series

suppose fileA kanika123ABC 1222222222222222 raciat5678ty 1221123333331121 jessica78ulllo 2233243223333333 so output shud be print only first 10 characters in series and rest remain same kanika123A 1222222222222222 raciat5678 1221123333331121 jessica78u ... (1 Reply)
Discussion started by: cdfd123
1 Replies

5. Shell Programming and Scripting

Print the first four characters of hostname

Hey, I'm trying to print the first four characters of the hostname of a computer. I can get it from using: hostname -s | sed 's/...........$//'" but this is when I know how many characters are in the computer name. I dont understand why some like: hostname -s | sed '/..../p' wont... (7 Replies)
Discussion started by: yxian
7 Replies

6. Shell Programming and Scripting

Ksh: Replace backslash characters

Hi All, I have a requirement to read a line from a file with some search string, replace any backslash characters in that line and store in a variable. Shell script: replace.ksh #!/bin/bash file2=input.rtf line=`grep "Invoice Number" ${file2} | head -1 | sed 's/\\//g'` echo "start... (6 Replies)
Discussion started by: prashas_d
6 Replies

7. Shell Programming and Scripting

Use awk to print first 6 characters

Hi, i want to use awk to print the first 6 characters of a variable awk -F"|" '$3>0 { print $3 }' z00.unl > z001.unl but $3= 7 digits and i just want to print the first 6 digits. eg 1005779 but i want to print only 100577 (3 Replies)
Discussion started by: dealerso
3 Replies

8. Shell Programming and Scripting

comparing special characters in KSH

Hi Guys, I came across a scenario where I have to check the starting character of line in a file. if it is a specile character i.e. "<" gretaer then perform action. I tried serval ways but could not get the work done. Please help me .... Thanks (6 Replies)
Discussion started by: ravi111_07
6 Replies

9. Shell Programming and Scripting

ksh check for non printable characters in a string

Hi All, I am trying to find non-printable characters in a string. The sting could have alphanumeric, puntuations and characters like (*&%$#.') but not non-printable (or that is what I think they are called) which are introduced when you copy any text from DOS to unix box. Input string1:... (10 Replies)
Discussion started by: dips_ag
10 Replies

10. Shell Programming and Scripting

ksh hidden characters in variables

Hi. I'm getting the following hidden characters \uat the start of a string after I pass in variables from the command line. I only noticed this when I set -x in my KSH script. Can anybody tell me how this happens and how to remove them? Many thanks. + STR=$'\uusername testuser1' + print... (12 Replies)
Discussion started by: user052009
12 Replies
resizeterm(3X)															    resizeterm(3X)

NAME
is_term_resized, resize_term, resizeterm - change the curses terminal size SYNOPSIS
#include <curses.h> bool is_term_resized(int lines, int columns); int resize_term(int lines, int columns); int resizeterm(int lines, int columns); DESCRIPTION
This is an extension to the curses library. It provides callers with a hook into the ncurses data to resize windows, primarily for use by programs running in an X Window terminal (e.g., xterm). The function resizeterm resizes the standard and current windows to the specified dimensions, and adjusts other bookkeeping data used by the ncurses library that record the window dimensions. Most of the work is done by the inner function resize_term. The outer function resizeterm adds bookkeeping for the SIGWINCH handler. When resizing the windows, resize_term blank-fills the areas that are extended. The calling application should fill in these areas with appro- priate data. The resize_term function attempts to resize all windows. However, due to the calling convention of pads, it is not possible to resize these without additional interaction with the application. A support function is_term_resized is provided so that applications can check if the resize_term function would modify the window struc- tures. It returns TRUE if the windows would be modified, and FALSE otherwise. RETURN VALUE
Except as notes, these function return the integer ERR upon failure and OK on success. They will fail if either of the dimensions are less than or equal to zero, or if an error occurs while (re)allocating memory for the windows. NOTES
While these functions are intended to be used to support a signal handler (i.e., for SIGWINCH), care should be taken to avoid invoking them in a context where malloc or realloc may have been interrupted, since it uses those functions. If ncurses is configured to supply its own SIGWINCH handler, the resizeterm function ungetch's a KEY_RESIZE which will be read on the next call to getch. This is used to alert an application that the screen size has changed, and that it should repaint special features such as pads that cannot be done automatically. SEE ALSO
wresize(3X). AUTHOR
Thomas Dickey (from an equivalent function written in 1988 for BSD curses). resizeterm(3X)
All times are GMT -4. The time now is 08:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy