Sponsored Content
Full Discussion: Fomatting o/p
Top Forums Shell Programming and Scripting Fomatting o/p Post 302928460 by Don Cragun on Thursday 11th of December 2014 08:42:09 PM
Old 12-11-2014
What operating system and shell are you using?

When you run your script as follows:
Code:
output_log hello|od -c

what output do you get? When you run your script as follows:
Code:
output_log abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 \
abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 \
abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789|od -c

what output do you get?

If your script is invoked as shown in the above two examples, what output do you want your script to produce?
 

We Also Found This Discussion For You

1. UNIX for Dummies Questions & Answers

Fomatting Solaris Hard Disk.

Hi Friends ! How long does it take to format a hard disk under Solaris ? Once the format starts, what data will be cleared or deleted first ? i.e whether the OS is cleared or all the data other than OS is cleared first ? Then, if the format starts and the power goes off, can i retrieve data?... (1 Reply)
Discussion started by: mrgubbala
1 Replies
strfind(3GEN)					     String Pattern-Matching Library Functions					     strfind(3GEN)

NAME
strfind, strrspn, strtrns, str - string manipulations SYNOPSIS
cc [ flag ... ] file ... -lgen [ library ... ] #include <libgen.h> int strfind(const char *as1, const char *as2); char *strrspn(const char *string, const char *tc); char * strtrns(const char *string, const char *old, const char *new, char *result); DESCRIPTION
The strfind() function returns the offset of the first occurrence of the second string, as2, if it is a substring of string as1. If the second string is not a substring of the first string strfind() returns -1. The strrspn() function trims chartacters from a string. It searches from the end of string for the first character that is not contained in tc. If such a character is found, strrspn() returns a pointer to the next character; otherwise, it returns a pointer to string. The strtrns() function transforms string and copies it into result. Any character that appears in old is replaced with the character in the same position in new. The new result is returned. USAGE
When compiling multithreaded applications, the _REENTRANT flag must be defined on the compile line. This flag should only be used in mul- tithreaded applications. EXAMPLES
Example 1: An example of the strfind() function. /* find offset to substring "hello" within as1 */ i = strfind(as1, "hello"); /* trim junk from end of string */ s2 = strrspn(s1, "*?#$%"); *s2 = ''; /* transform lower case to upper case */ a1[] = "abcdefghijklmnopqrstuvwxyz"; a2[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; s2 = strtrns(s1, a1, a2, s2); ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
string(3C), attributes(5) SunOS 5.10 20 Jan 1999 strfind(3GEN)
All times are GMT -4. The time now is 09:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy