Sponsored Content
Full Discussion: Print N characters in ksh
Top Forums Shell Programming and Scripting Print N characters in ksh Post 302467133 by vgersh99 on Thursday 28th of October 2010 10:30:58 AM
Old 10-28-2010
Quote:
Originally Posted by iga3725
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
for example - the others would be similar:
Code:
nawk -v width=${COLUMNS} 'BEGIN{$width=OFS="*";print}'

 

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
times(1)							   User Commands							  times(1)

NAME
times - shell built-in function to report time usages of the current shell SYNOPSIS
sh times ksh times DESCRIPTION
sh Print the accumulated user and system times for processes run from the shell. ksh Print the accumulated user and system times for the shell and for processes run from the shell. On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari- able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not performed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
ksh(1), sh(1), time(1), attributes(5) SunOS 5.10 15 Apr 1994 times(1)
All times are GMT -4. The time now is 12:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy