Hi guys,
I am new to AWK and unix scripting. Please see below my problem and let me know if anyone you can help.
I have 2 input files (example given below)
Input file 2 is a standard file (it will not change) and we have to get the name (second column after comma) from it and append it... (5 Replies)
well I found lot of topics about awk..about if command in awk..
but I had to implement this:
nawk -F"|" '
$47 ~ /0R0011/ { print > ("/home/user/M/MC.tmp" )}
$47 ~ /0R0012/ { print > ("/home/user/M/DuSI.tmp" )}
$47 ~ /0R0014/ { print > ("/home/user/M/FF.tmp" )}
$47 ~ /0R0018/ { print >... (9 Replies)
Hi,
I am trying to create a while loop that will do the following:
INFILE= list of new records that need to be added after last previous record
while read record
do
find the last record processed
create list of new records output to a file
echo "$record">> $NEWFILE
done
... (9 Replies)
Hi Guys,
I need to check whether the last column is RP, If so, then i have to second column and pass it to a select statement as sonid and fetch the value to a variable and run it. This has to be done till the last column is RW.
value Fatherid sonid topid ... (8 Replies)
I am trying to read a file in a shl script (only one record) and stored in a variable file_number
I got the following
read -u $BANNER_HOME/xxxxxxx/misc/EFTSQL.dat file_number
file_number2 = $file_number + 1
echo $file_number2 > $BANNER_HOME/xxxxxx/misc/EFTSQL.dat
EOF
It is not working... (2 Replies)
Hi All,
I have a requirement, I had a parent directory Land under that we have sub directories
Yesterday,
Today and
Tommorrow
And we have a file test.txt under the above directories Yesterday, Today and Tommorrow
The data in the file test.txt under Yesterday folder is ... (5 Replies)
Hi,
I am reading file records inside a while loop,
and want to update the record when certain condition is met.
How can I update a file while being read?
I want to avoid using temporary files, copy, rename, ...
while IFS=',' read -r f1 f2
do
function(f1,f2)
if
then
<add... (1 Reply)
Hi,
I need to set "prd" in the below command to a unix variable
nawk '/^#/ {next} FNR==NR {prd;next} !($0 in prd)'
So, this is what i did
fname=prd // unix shell variable
nawk -v fname=$fname '/^#/ {next} FNR==NR {fname;next} !($0 in fname)'But the value of fname i.e "prd" is not... (8 Replies)
Hi,
Here is my command
print $2 was meant to select the second column however, it is getting substituted with the second argument that was passed to the script.
Can you please tell me how can I resolve this ? (6 Replies)
Discussion started by: mohtashims
6 Replies
LEARN ABOUT PHP
msg_send
MSG_SEND(3) 1 MSG_SEND(3)msg_send - Send a message to a message queueSYNOPSIS
bool msg_send (resource $queue, int $msgtype, mixed $message, [bool $serialize = true], [bool $blocking = true], [int &$errorcode])
DESCRIPTION msg_send(3) sends a $message of type $msgtype (which MUST be greater than 0) to the message queue specified by $queue.
PARAMETERS
o $queue
-
o $msgtype
-
o $message
-
o $serialize
- The optional $serialize controls how the $message is sent. $serialize defaults to TRUE which means that the $message is serial-
ized using the same mechanism as the session module before being sent to the queue. This allows complex arrays and objects to be
sent to other PHP scripts, or if you are using the WDDX serializer, to any WDDX compatible client.
o $blocking
- If the message is too large to fit in the queue, your script will wait until another process reads messages from the queue and
frees enough space for your message to be sent. This is called blocking; you can prevent blocking by setting the optional $block-
ing parameter to FALSE, in which case msg_send(3) will immediately return FALSE if the message is too big for the queue, and set
the optional $errorcode to MSG_EAGAIN, indicating that you should try to send your message again a little later on.
o $errorcode
-
RETURN VALUES
Returns TRUE on success or FALSE on failure.
Upon successful completion the message queue data structure is updated as follows: $msg_lspid is set to the process-ID of the calling
process, $msg_qnum is incremented by 1 and $msg_stime is set to the current time.
SEE ALSO msg_remove_queue(3), msg_receive(3), msg_stat_queue(3), msg_set_queue(3).
PHP Documentation Group MSG_SEND(3)