06-06-2003
ah ha!! it works a treat! (except for erasing the rest of the line)
thank you loads, oombera and everyone else
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Using Solaris 8.
I need to create a shell script that will edit a text file.
I need to look in the text file and do a search and replace. For instance, the text file name is always 'filename'. I need to open filename and replace every instance of 'oldtext' with 'newtext'. 'oldtext' is static. ... (3 Replies)
Discussion started by: jowpup
3 Replies
2. Shell Programming and Scripting
Morning All: I know this might be easy but since I don't do this very often I get stumped real quick... Sun box Solaris 8 ksh...
I need to edit a file via a shell script. In this file I need to locate one specific line and then remove that line plus the next 20 line below that....
Any... (2 Replies)
Discussion started by: jimmyc
2 Replies
3. Shell Programming and Scripting
Hi,
I am having a business file in excel having charts based on data already present on it. I would like to add new rows after the existing data and refesh the chart on it using shell script.
For example--
In excel file in "sheet1", There is some data in first 10 rows ( from column A to F).... (0 Replies)
Discussion started by: sanjay1979
0 Replies
4. Shell Programming and Scripting
HI all,
I have file in the below format
1111111111_222222222_3333333
111111_22222_33333
11111111_222222_33333333333
i need to display this file like this
2222222_1111111111
22222_11111111
22222222222_1111111111111
can anyone help me with this
Thanks in advance (1 Reply)
Discussion started by: saravanan71184
1 Replies
5. Shell Programming and Scripting
Gurus,
I need to write a shell script that will calculate hash value of a file, opens the file in an application for example vi editor. The application can read or modify the contents of the file. When application exists second part of my script will kick in and recalculate the hash value. File... (1 Reply)
Discussion started by: c0kazaz
1 Replies
6. Shell Programming and Scripting
Hello dear users, here I have a script to manipulate .csv files that are like this originally:
And I need to make a script to delete certain fields. Each field is separated with a comma.
So, here is my script (at least a part of it):
Field $1 is composed of a name, and then a... (5 Replies)
Discussion started by: sr00t
5 Replies
7. Shell Programming and Scripting
Hi Folks,
It is regarding the perl scripting.
I have an html file(many files) which contains the below line in the body tag.
<body>
<P><STRONG><FONT face="comic sans ms,cursive,sans-serif"><EM>Hello</EM></FONT></STRONG></P>
</body>
Now I want to read that html file through perl... (3 Replies)
Discussion started by: giridhar276
3 Replies
8. Shell Programming and Scripting
Hi All,
I have below requirements for my project:
1. Building a shell script which connects to a remote server
2. running script on local machine as user 'A'
3. connecting to server using user 'B' with password
4. login with a powerbroker role 'P' (asks for same password as 'B') on that... (1 Reply)
Discussion started by: Nishant Ladiwal
1 Replies
9. Shell Programming and Scripting
Hi Scott,
My previous post was not for any school or college projects. I am currently working with a IT company (Cannot provide more details than this). I am trying to implement the below script in my day-to-day work,
Apologies for the confusion in previous post :). My question remains same... (4 Replies)
Discussion started by: Nishant Ladiwal
4 Replies
10. Shell Programming and Scripting
I am trying to automate editing of a json file using bash script.
The file I initially receive is
{
"appMap": {
"URL1": {
"name": "a"
},
"URL2": {
"name": "b"
},
"URL3": {
"name": "c"
},
}
WHat I would like to do is replace... (5 Replies)
Discussion started by: Junaid Subhani
5 Replies
MB(9) BSD Kernel Developer's Manual MB(9)
NAME
mb, mb_memory, mb_read, mb_write -- memory barriers
SYNOPSIS
#include <sys/lock.h>
void
mb_memory(void);
void
mb_read(void);
void
mb_write(void);
DESCRIPTION
Many types of processor can execute instructions in a different order than issued by the compiler or assembler. On a uniprocessor system,
out of order execution is transparent to the programmer, operating system and applications, as the processor must ensure that it is self con-
sistent.
On multiprocessor systems, out of order execution can present a problem where locks are not used to guarantee atomicity of access, because
loads and stores issued by any given processor can appear on the system bus (and thus appear to other processors) in an unpredictable order.
mb_memory(), mb_read(), and mb_write() can be used to control the order in which memory accesses occur, and thus the order in which those
accesses become visible to other processors. They can be used to implement ``lockless'' access to data structures where the necessary bar-
rier conditions are well understood.
Memory barriers can be computationally expensive, as they are considered ``serializing'' operations and may stall further execution until the
processor has drained internal buffers and re-synchronized.
The memory barrier primitives control only the order of memory access. They provide no guarantee that stores have been flushed to the bus,
or that loads have been made from the bus.
The memory barrier primitives are guaranteed only to prevent reordering of accesses to main memory. They do not provide any guarantee of
ordering when used with device memory (for example, loads or stores to or from a PCI device). To guarantee ordering of access to device mem-
ory, the bus_dma(9) and bus_space(9) interfaces should be used.
FUNCTIONS
mb_memory()
Issue a full memory barrier, ordering all memory accesses. Causes all loads and stores preceding the call to mb_memory() to complete
before further memory accesses can be made.
mb_read()
Issue a read memory barrier, ordering all loads from memory. Causes all loads preceding the call to mb_read() to complete before fur-
ther loads can be made. Stores may be reordered ahead of or behind a call to mb_read().
mb_write()
Issue a write memory barrier, ordering all stores to memory. Causes all stores preceding the call to mb_write() to complete before
further stores can be made. Loads may be reordered ahead of or behind a call to mb_write().
SEE ALSO
__insn_barrier(3), bus_dma(9), bus_space(9), mutex(9), rwlock(9)
HISTORY
The memory barrier primitives first appeared in NetBSD 5.0.
BSD
January 2, 2011 BSD