02-19-2020
As you have now valid solutions to your issue AND as we are not here to do the work for you its time to close this thread knowing that you are not following the new rules
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Friends,
I am trying to run a sql query from shell script as below but I get "Bind variable "1" not declared" error.
1.sh shell script has following:
sDb="abc/xyz@aaa"
a="1.sql"
sqlplus -s $sDb @$a $1
1.sql file has following:
spool Result.tmp append
select cust_name from orders... (1 Reply)
Discussion started by: ppat7046
1 Replies
2. Shell Programming and Scripting
Hi,
I have a script that transfers files from a Solaris server to target unix servers. The script uses Net::FTP->put to write the files, which can be any number of files, not always the same. This script works flawlessly to many servers.
For one particular instance of the script,... (3 Replies)
Discussion started by: csgonan
3 Replies
3. Shell Programming and Scripting
What I am doing is creating a top menu, which a user will select a choice with a number entry. That number corresponds to a string in an array. I then want to assign that response to another array I've already declared.
For example:
#!/bin/bash
colors=(red blue yellow)
red=(cherry fire)... (2 Replies)
Discussion started by: Akilleez
2 Replies
4. Shell Programming and Scripting
I have following expression:
echo "Sun 12 Jul BST 2014\nSun 12 Jul 2014\nSun 12 Jul IS 2014" | awk '/(Sun)+( 12)+( Jul )+({3} )?(2014)/{print;}'
I ran above code in AIX box and output is as follows
Sun 12 Jul BST 2014
Sun 12 Jul 2014
I ran above code in Linux box and output is as... (8 Replies)
Discussion started by: kamlesh_pradhan
8 Replies
5. Shell Programming and Scripting
Hi,
On linux i have the below command working fine.
grep -o '<name>.*</name>' deploy.tmp | sed 's/\(<name>\|<\/name>\)//g' deploy.tmp
But the same is failing on Solaris
uname -a
SunOS mymac 5.10 Generic_150400-23 sun4v sparc sun4v
Can you tell me how can i get it work on Solaris ?... (6 Replies)
Discussion started by: mohtashims
6 Replies
6. Shell Programming and Scripting
On linux i have the below command working fine.
awk '/<app-deploy>/{A=1;++i} /<\/app-deploy>/{print >> "found"i".tmp";A=0} A{;print >> "found"i".tmp"}' deploy.xml
But the same is failing on Solaris
Output:
awk: syntax error near line 1
awk: bailing out near line 1
uname -a SunOS mymac 5.10... (5 Replies)
Discussion started by: mohtashims
5 Replies
7. Shell Programming and Scripting
Hi,
On Linux i get the desired ouput:
echo "<value>WEB_USER</value>" | sed 's/\(<value>\|<\/value>\)//g'Output:
Executing the same command on Solaris:
echo "<value>WEB_USER</value>" | sed 's/\(<value>\|<\/value>\)//g'Output:
I need to get the desired output on Solaris i.e. WEB_USER and... (4 Replies)
Discussion started by: mohtashims
4 Replies
8. UNIX for Beginners Questions & Answers
Hi,
i am new here let me say HI for all.
now i have a question please:
i am sending one command to my machine to create 3 names.
if one of the names exists then the box return error message that already have the name but will continue to create the rests.
How i can break the command and... (7 Replies)
Discussion started by: Amiri
7 Replies
9. Shell Programming and Scripting
Hi,
I am looking for a generic find command that works on both Linux and Solaris.
I have the below command that works fine on Linux but fails on solaris.find /web/config -type f '(' -name '*.txt' -or -name '*.xml' -name '*.pro' ')' Fails on SunOS mysolaris 5.10 Generic_150400-61 sun4v sparc... (1 Reply)
Discussion started by: mohtashims
1 Replies
10. Shell Programming and Scripting
I wish to replace "\\n" with a single white space.
The below does the job on command-line:
$ echo '/fin/app/scripts\\n/fin/app/01/sql' | sed -e 's#\\\\n# #g';
/fin/app/scripts /fin/app/01/sql
However, when i have the same code to a shell script it is not able to get me the same output:... (8 Replies)
Discussion started by: mohtashims
8 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)