Increase efficiency.
Consider redirection in larger portions.
Or even better
Maybe you can save the loop and do everything in sed using its built-in loop?
This User Gave Thanks to MadeInGermany For This Post:
I followed the egrep example given in the thread "parse text or complex grep ?". It is exactly what I need...except... how do I insert a blank line after the second line? My exact command is:
egrep 'patt1|patt2' filename
the result is:
patt1
patt2
patt1
patt2
and so on. I would... (2 Replies)
Hello friends,
I have a C source code containing sql statements. I use the following sed command to print all the sql blocks in the source code....
sed -n "/exec sql/,/;/p" Sample.cpp
The above sed command will print the sql blocks based on the pattern "exec sql" & ";"... (2 Replies)
the following range matching works great but i wish to add a blank line after each range result set... which i've tried and researched to no avail
MY INPUT DATA:
CURRENT CODE I'M USING:
sed -n '/*$/,/;/p' $INPUT_FILE
RESULTS I'M GETTING:
RESULT I looking to... (5 Replies)
Hello...
I have a file which contain certain number of records.
I want to generate another file from this file which will contain 1st line as a blank line & after every 5 lines one blank line will be inserted. How to achieve this through shell scripting?
Thanks... (5 Replies)
I use the following as part of a script to correct for a faulty hostname file.
# get the domain name
read -r thehostname < /etc/hostname
dom="$(echo $thehostname | cut -d'.' -f2)"
numchar=${#dom}
if
then
echo "It appears as though the hostname is not correctly set."
echo "Hostname has... (5 Replies)
Hi
I want to display the following input data into the tabular format as shown in the output.
Input.txt:
Following jobs are in pending state for more than 10 minutes:
JOB_ID JOB_SUBMIT_ID
MAHAR 784308
PUNJA 109367
Following jobs are running for longer time:
JOB_ID... (1 Reply)
Hi ,
i am generating some data by firing sql query with connecting to the database by my solaris box.
The below one should be the header line of my excel ,here its coming in separate row.
TO_CHAR(C. CURR_EMP_NO
---------- ---------------
LST_NM... (6 Replies)
Dears Please support
I have out put in text file and look like below
fixed inquiries - Click on MAX suffix http://server:port/app
User Details http://server:port/app
Audit User Detail Action hhttp://server:port/app
fixed inquiries - Click on MAX suffix http://server:port/app
User Details ... (13 Replies)
Hello Guys,
developing a monitoring shell script to have my queue depth count over mail .
here is the sample input file to the script which has all the queue names 1 : DISPLAY QUEUE(*) WHERE (CURDEPTH GT 0)
ZFC8409: Display Queue details.
QUEUE(QL.GVR.ATA.CACHE.01) ... (10 Replies)
Discussion started by: wims
10 Replies
LEARN ABOUT SUNOS
echo
echo(1B) SunOS/BSD Compatibility Package Commands echo(1B)NAME
echo - echo arguments to standard output
SYNOPSIS
/usr/ucb/echo [-n] [argument]
DESCRIPTION
echo writes its arguments, separated by BLANKs and terminated by a NEWLINE, to the standard output.
echo is useful for producing diagnostics in command files and for sending known data into a pipe, and for displaying the contents of envi-
ronment variables.
For example, you can use echo to determine how many subdirectories below the root directory (/) is your current directory, as follows:
o echo your current-working-directory's full pathname
o pipe the output through tr to translate the path's embedded slash-characters into space-characters
o pipe that output through wc -w for a count of the names in your path.
example% /usr/bin/echo "echo $PWD | tr '/' ' ' | wc -w"
See tr(1) and wc(1) for their functionality.
The shells csh(1), ksh(1), and sh(1), each have an echo built-in command, which, by default, will have precedence, and will be invoked if
the user calls echo without a full pathname. /usr/ucb/echo and csh's echo() have an -n option, but do not understand back-slashed escape
characters. sh's echo(), ksh's echo(), and /usr/bin/echo, on the other hand, understand the black-slashed escape characters, and ksh's
echo() also understands a as the audible bell character; however, these commands do not have an -n option.
OPTIONS -n Do not add the NEWLINE to the output.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscpu |
+-----------------------------+-----------------------------+
SEE ALSO csh(1), echo(1), ksh(1), sh(1), tr(1), wc(1), attributes(5)NOTES
The -n option is a transition aid for BSD applications, and may not be supported in future releases.
SunOS 5.10 3 Aug 1994 echo(1B)