9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
2. Shell Programming and Scripting
Look at the following data file(cou.data) which has four fields separated by tab.
Four fields are country name, land area, population, continent where it belongs.
As for country name or continent name which has two words, two words are separated by space.
(Data are not accurately... (1 Reply)
Discussion started by: chihuyu
1 Replies
3. UNIX for Dummies Questions & Answers
Please can you help me understand the significance of providing arguments under sh -s in
> ssh -qtt ${user}@${host} "sh -s "${version}"" < test.sh (4 Replies)
Discussion started by: Sree10
4 Replies
4. UNIX for Advanced & Expert Users
Hi,
I have installed RHEL4 using vmware workstation..
Host OS: Windows XP
Guest OS: RHEL4
Pls refer step 17 & 18 in below link...
ORACLE-BASE - Red Hat Enterprise Linux 4 and Centos 4 Installation
1) If i choose to assign IP automatically (using DHCP) means, i am able to connect RHEL4... (3 Replies)
Discussion started by: thomasraj87
3 Replies
5. Solaris
Version Details
Solaris version : Oracle Solaris 10 8/11 s10x_u10wos_17b X86
$ uname -a
SunOS tippy178 5.10 Generic_147441-01 i86pc i386 i86pcThe Issue
+++++++++
I have two solaris 10 Virtual Machines created using Virtual Box. One of my applications running on Source was trying to connect... (9 Replies)
Discussion started by: kraljic
9 Replies
6. UNIX for Dummies Questions & Answers
I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this:
$ look "string" "/home/patrick/filename.txt"
However, this gives me the following message:
"look: /home/patrick/filename.txt: File too large"
So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies
7. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
8. UNIX for Advanced & Expert Users
Good day.
I really hope U can help me with this as I'm stumped!
In the command line eg: read X; echo $x . Works perfectly fine.
Then running the same thing in my script it sometimes exiqute immediatly after pressing enter and continuiing. Not exiting the script I re-run the "read" section.... (1 Reply)
Discussion started by: Blooper1980
1 Replies
9. HP-UX
Hi people!
I've got this own library:
--------------------------------------------
Personal.h
--------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <stdarg.h>
#include <string.h> ... (0 Replies)
Discussion started by: donatoll
0 Replies
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)