01-27-2018
Moderator's Comments:
|
|
Please start a new thread for your new problem.
Asking people to explain code for one problem while asking for new code for a new problem in one thread is a great way to confuse people who are try to help you and to confuse people who are reading your thread and trying to learn from the problem(s) presented therein.
|
|
This User Gave Thanks to Don Cragun For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How would I write a command(s) to read from a file (list) that looks like this: 29847374384 and grep from a second file (list) that looks like this: 29847374384, jkdfkjdf,3833,ddd:confused: (1 Reply)
Discussion started by: smellylizzard
1 Replies
2. UNIX for Dummies Questions & Answers
I have a diff command that does what I want but when comparing large text/log files, it uses up all the memory I have (sometimes over 8gig of memory)
diff file1.txt file2.txt | grep '^<'| awk '{$1="";print $0}' | sed 's/^ *//'
Is there a better more efficient way to find the lines in one file... (5 Replies)
Discussion started by: raptor25
5 Replies
3. Shell Programming and Scripting
Hi,
I have script which generates the output as below:
Jobname Date Time Status
abc 12/9/11 17:00 Completed
xyz 13/9/11 21:00 Running
I have the output as a text file. I need to convert it into a HTML Table and sent it thru email
... (6 Replies)
Discussion started by: a12ka4
6 Replies
4. Shell Programming and Scripting
This is appending a column.
My question is fairly simple. I have a program generating data in a form like so:
1 20
2 22
3 23
4 12
5 43
For ever iteration I'm generating this data. I have the basic idea with cut -f 2 fileA.txt | paste -d >> FileB.txt ???? I want FileB.txt to grow, and... (4 Replies)
Discussion started by: theawknewbie
4 Replies
5. UNIX for Dummies Questions & Answers
Hi Experts,
can guide how we can Update a Database Table using a txt file source Using
Unix Shell Scripts.
What are the Cron Jobs codes can written to Update DB table.
txt file contains record like data.
US 09/03/2012 User DocType DocID.
these above feilds in txt files need to be updated in... (4 Replies)
Discussion started by: mahesh.sap
4 Replies
6. Shell Programming and Scripting
I have a text file called file.txt which has a list of file as shown below that i need to find and copy to a particular location.
FILENAMES
skter.pdf
abcdf.sas
tereen.lst
abc12.txt
i am using following code and it never works however i try it.
cat file.txt | while read FILENAME;do find... (4 Replies)
Discussion started by: MILAN KUMAR
4 Replies
7. Shell Programming and Scripting
Dear all,
I have a huge txt file (DATA.txt) with the following content . From this txt file, I want the following output using some shell script.
Any help is greatly appreciated.
Greetings,
emily
DATA.txt (snippet of the huge text file)
407202849... (2 Replies)
Discussion started by: emily
2 Replies
8. Shell Programming and Scripting
My concnern related to the post
-Convert shell script output txt file to html table,
in this how to print the heading as color.
awk 'BEGIN{print "<table>"} {print "<tr>";for(i=1;i<=NF;i++)print "<td>" $i"</td>";print "</tr>"} END{print "</table>"}' <filename> (8 Replies)
Discussion started by: sarajobmai
8 Replies
9. Shell Programming and Scripting
i have written my shell script in notepad however i am struggling to pass the data file to be read to the script the data file is of .txt format. My target is to run the shell script from the terminal and pass 3 arguments e.g. polg@DESKTOP-BVPDC5C:~/CS1420/coursework$ bash valsplit.sh input.txt... (11 Replies)
Discussion started by: Gurdza32
11 Replies
10. Shell Programming and Scripting
Hi dears
i use bash shell
i have INPUT.txt
like this
number of columns different in one
some row have 12 , some 11 columns
see last column
INPUT.txt
CodeGender Age Grade Dialect Session Sentence Start End Length Phonemic Phonetic
63 M 27 BS/BA TEHRANI 3 4 298320 310050... (2 Replies)
Discussion started by: alii
2 Replies
LEARN ABOUT DEBIAN
ns_thread
ns_thread(3aolserver) AOLserver Built-In Commands ns_thread(3aolserver)
__________________________________________________________________________________________________________________________________________________
NAME
ns_thread - commands
SYNOPSIS
ns_thread begin script
ns_thread begindetached script
ns_thread get
ns_thread getid
ns_thread wait tid
ns_thread yield
_________________________________________________________________
DESCRIPTION
ns_thread begin:
begins a new thread which evaluates the specified script and then exits. It returns a thread ID that must eventually be passed to
ns_thread wait. (Failing to call ns_thread wait will eventually result in no new threads being created.)
ns_thread begindetached:
begins a detached thread that doesn't have to be (and can't be) waited for.
ns_thread get:
gets the thread ID of the current thread. The result is a thread ID that can be passed to ns_thread wait and may look something like
"tid532".
ns_thread getid:
gets the thread integer number for the current thread. The result is a small integer used for identifying threads is a human-read-
able way, such as "1" or "1120", for example.
ns_thread wait:
waits for the specified thread to exit. The tid argument is a thread ID returned by ns_thread begin or ns_thread get.
ns_thread yield:
causes the current thread to yield.
EXAMPLES
This example is similar to the example under the ns_sockselect function of connecting to the 10 servers and waiting to service them with
the ns_sockselect command. In this case, though, each connection gets it's own thread.
# This is the procedure which is evaluated for each thread and # handles a single connection to host number $i
proc getpage {i} {
global pages
# new thread will start here - first connect to host
set host [format "www%2d.foo.com" $i]
set fds [ns_sockopen $host 80
set r [lindex $fds 0]
set w [lindex $fds 1]
# next, send request 0r"
puts $w "GET /index.htm HTTP/1.0
flush $w
# then read page
set pages($i) [read $r]
# and close sockets
close $w
close $r
# thread goes away here and other threads waiting
# on ns_thread wait will wakeup }
# Here's the loop which creates the threads which run getpage. for {set i 1} {$i < 9} {incr i} {
set tids($i) [ns_thread begin "getpage $i"] }
# wait for the threads to exit and then process the pages for {set i 1} {$i < 9} {incr i} {
ns_thread wait $tids($i)
# output page
... process the page in $pages($i) put there by other thread ... }
Note that the code here is much simpler to follow than the ns_sockselect example; that's the benefit of multithreaded programming. However,
it uses more resources as threads need to be created and initialized. This can be a problem if you plan to create many threads.
SEE ALSO
KEYWORDS
threads
AOLserver 4.0 ns_thread(3aolserver)