08-19-2013
Sorry did not work... Same output as before capitanui and prasperl
Last edited by Junes; 08-19-2013 at 08:56 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
So, I want to read line-by-line a text file with unknown number of files....
So:
a=1
b=1
while ; do
b=`sed -n '$ap' test`
a=`expr $a + 1`
$here do something with b etc
done
the problem is that sed does not seem to recognise the $a, even when trying
sed -n ' $a p'
So, I cannot read... (3 Replies)
Discussion started by: hakermania
3 Replies
2. Shell Programming and Scripting
Hi all
Is there a way to read and process a gzip file line by line similar to a text file without using gzcat..
while processing a text file we will usually use the logic
exec<sample.txt
while read line
do
echo $line
done
Is there a similar way to process the gz file in the same... (4 Replies)
Discussion started by: aikhaman
4 Replies
3. Shell Programming and Scripting
Hi,
I have a line which has n number of words with separated by space.
I wanted to make each word as a separate line.
for example,
i have a file that has line like
i am a good boy
i want the output like,
i
am
a
good (8 Replies)
Discussion started by: rbalaj16
8 Replies
4. UNIX for Dummies Questions & Answers
Hello board members.. here i am and here is my question.
OS HP-UX
awk
i have a file where the FS is the pipe (|).
So i choose the second field and i would like to do the following:
If this filed is 0 then, i need the line in file1.txt
Else write the line in file2.txt
cat testfile.txt |... (2 Replies)
Discussion started by: kiko
2 Replies
5. Shell Programming and Scripting
Hi All,
I am trying to write a shell script but not getting desired output.
What i am trying to do.
1.I want to use find command command and then use it xargs/exec to append the find output.But i am not getting desired output
here is what i am trying to do
#find init*.ora -exec `echo... (4 Replies)
Discussion started by: sahil_shine
4 Replies
6. Programming
Hi, could you please help with the following:
I have an input file like:
one
two
three
four
five
six
I want to print the lines starting from 'three' to the empty line.
Something like that:
if ( line == "three" )
{
while ( !line.empty() )
{
cout <<... (0 Replies)
Discussion started by: apenkov
0 Replies
7. Shell Programming and Scripting
hi Gurus,
I need separate a file which is one huge line to multiple lines based on certain number of charactors. for example:
abcdefghi high abaddffdd
I want to separate the line to multiple lines for every 4 charactors.
the result should be
abcd
efgh
i hi
gh a
badd
ffdd
Thanks in... (5 Replies)
Discussion started by: ken6503
5 Replies
8. Shell Programming and Scripting
Hi,
I'm on AIX 5.2. I wrote a script that makes a traceroute to a host. The script works fine but each time it using the traceroute command its generate the 2 output lines.
this is the command in my script
traceroute -n -m 5 -w 2 $Host | grep 172 | awk '{print $2}' | tail -1
traceroute... (2 Replies)
Discussion started by: ce9888
2 Replies
9. HP-UX
Hello folks,
I've found an HP-UX server with a rare 'ls -l' output. Please see the attached file.
Anybody knows how can I change the output to not have this extra tabulations?
Thanks in advance! (10 Replies)
Discussion started by: carpannav
10 Replies
10. UNIX for Beginners Questions & Answers
Input file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 (6 Replies)
Discussion started by: Sagar Singh
6 Replies
LEARN ABOUT HPUX
xtappaddworkproc
XtAppAddWorkProc() XtAppAddWorkProc()
XtAppAddWorkProc - register a procedure to be called when the event loop is idle.
Synopsis
XtWorkProcId XtAppAddWorkProc(app_context, proc, client_data)
XtAppContext app_context;
XtWorkProc proc;
XtPointer client_data;
Inputs
app_context
Specifies the application context.
proc Specifies the procedure that is to be called when the application is idle.
client_data
Specifies data to be passed to proc when it is called.
Returns
A handle of type XtWorkProcId that can be passed to XtRemoveWorkProc() to unregister the work procedure.
Description
XtAddWorkProc() registers the procedure proc and the data client_data to be called by XtAppNextEvent() or XtAppProcessEvent() when there
are no pending input events and it would otherwise block. Multiple work procedures can be registered, and the most recently added one is
always the one that is called. However, if a work procedure itself adds another work procedure, the newly added one has lower priority
than the current one.
A work procedure returns a Boolean. If it returns True, it will automatically be unregistered and will not be called again. If it returns
False it will be called the next time the application is idle. See XtWorkProc(2) for more information.
Usage
XtAppAddWorkProc() implements a limited form of background processing. Most applications spend most of their time waiting for input; to do
useful work during this idle time, you can register a work procedure that will run when the application is idle.
A work procedure must return quickly or the application will not be able to promptly respond to user events. If a large task needs to be
done in the background, the work procedure should periodically save its state and return False. Work procedures should not be used to do
frivolous work in the background. In a multi-tasking system, an idle application should generally actually be idle, and not steal CPU time
from other processes.
A work procedure can be explicitly removed by calling XtRemoveWorkProc() with the XtWorkProcId returned by this function.
Structures
The XtWorkProcId type is defined as follows:
typedef unsigned long XtWorkProcId;
See Also
XtAppNextEvent(1), XtAppProcessEvent(1), XtRemoveWorkProc(1),
XtWorkProc(2).
Xt - Event Handling XtAppAddWorkProc()