hello all
i request you to give the solution for the following problem..
I want read the text file.and print the contents character by character..like if the text file contains google means..i want to print
g
go
goo
goog
googl
google
like this Using unix Shell scripting...
without using... (1 Reply)
I decided I wanted to have the cd command print my full working directory after each cd command, so I put this cw command in .bashrc as a function.
cw ()
{
cd "${1}"
pwd
}While this works I would like pwd to print escapes when a space in a directory name exists. This would... (7 Replies)
Hi
I want to write a shell script to print only those words from a file whose beginning
and last character are same.
Please help.
Thanks,
vini (5 Replies)
My current code is:
user@ubuntu:~/Desktop$ grep -e "\(packaged by\)\|\(employee\)\|\(file name\)\|\(Total Data (MB) Read\)\|\(Begin Time\)" log.txt
packaged by = Ron Mexico
employee = Michael Vick
file name = Mike_Vick_2011.bat
Total Data (MB) Read: 11.82
Begin Time: 6/13/2011... (8 Replies)
Hi,
In my file, for few field I have to print the next ASCII character for every character.
In the below file, I have to do for the 2,3 and 5th fields.
Input File
========
1|abc|def|5|ghi
2|jkl|mno|6|pqr
Expected
Ouput file
=======
1|bcd|efg|5|hij
2|klm|nop|6|qrs (2 Replies)
In python, if I use '\', error, use "\", error again, use '\\' or "\\", the print result will be \\
If I want to print a single \, what can I do?
Thanks in advance
Sorry... I have solved this problem...
Thanks anyway (2 Replies)
Hello, I am reading the K & R C book, and trying to understand more about putchar()/getchar() by practice. Similar to the exercise 1-12, I want try to parse each line by character. Although there are many site about the exercise, but I could find similar case of mine, which is similar to fold... (11 Replies)
Hi Gurus, i need your help to create a script the will print a characters after the pattern was found.
Sample lines are below:
My birthday:"1977-16-07", My birthday:"1975-16-07"
My birthday:"1970-16-07".
My patter should be "birthday:", then i want to print the following characters which... (18 Replies)
hi,
Is it possible to print a particular character n number of times in a line?
for example.
i am print the following line using echo command..
echo "files successfully moved"
i want to count the number of characters that are been displayed. i am doin it using
echo "files... (8 Replies)
Discussion started by: Little
8 Replies
LEARN ABOUT OPENSOLARIS
print
print(1) User Commands print(1)NAME
print - shell built-in function to output characters to the screen or window
SYNOPSIS
ksh
print [-Rnprsu [n]] [arg]...
ksh93
print [-Renprs] [-f format] [-u fd] [string...]
DESCRIPTION
ksh
The shell output mechanism. When no options are specified, or when an option followed by ' a - is specified, or when just - is specified,
the arguments are printed on standard output as described by echo(1).
ksh93
By default, print writes each string operand to standard output and appends a NEWLINE character.
Unless, the -r, -R, or -f option is speciifed, each character in each string operand is processed specially as follows:
a Alert character.
Backspace character.
c Terminate output without appending NEWLINE. The remaining string operands are ignored.
E Escape character (ASCII octal 033).
f FORM FEED character.
NEWLINE character.
Tab character.
v Vertical tab character.
\ Backslash character.
x The 8-bit character whose ASCII code is the 1-, 2-, or 3-digit octal number x.
OPTIONS
ksh
The following options are supported by ksh:
-n Suppresses new-line from being added to the output.
-r-R Raw mode. Ignore the escape conventions of echo. The -R option prints all subsequent arguments and options other than -n.
-p Cause the arguments to be written onto the pipe of the process spawned with |& instead of standard output.
-s Cause the arguments to be written onto the history file instead of standard output.
-u [ n ] Specify a one digit file descriptor unit number n on which the output is placed. The default is 1.
ksh93
The following options are supported by ksh93:
-e Unless -f is specified, process sequences in each string operand as described above. This is the default behavior.
If both -e and -r are specified, the last one specified is the one that is used.
-f format Write the string arguments using the format string format and do not append a NEWLINE. See printf(1) for details on how to
specify format.
When the -f option is specified and there are more string operands than format specifiers, the format string is reprocessed
from the beginning. If there are fewer string operands than format specifiers, then outputting ends at the first unneeded for-
mat specifier.
-n Do not append a NEWLINE character to the output.
-p Write to the current co-process instead of standard output.
-r Do not process sequences in each string operand as described above.
-R
If both -e and -r are specified, the last one specified is the one that is used.
-s Write the output as an entry in the shell history file instead of standard output.
-u fd Write to file descriptor number fd instead of standard output. The default value is 1.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
>0 Output file is not open for writing.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO echo(1), ksh(1), ksh93(1), printf(1), attributes(5)SunOS 5.11 27 Mar 2008 print(1)