Sponsored Content
Full Discussion: bourne shell timing question
Top Forums UNIX for Dummies Questions & Answers bourne shell timing question Post 46937 by gillbates on Thursday 29th of January 2004 11:27:52 AM
Old 01-29-2004
I'm very good at producing bugs myself. But this code has run as is for years. The server was moved last weekend but I don't think there were any os changes. By the way, the sabotage line came from a user (ex submariner) that decided his bugs had to be sabotage. But considering that these files contain the processes pid to ensure they don't get overwritten by another instance of the process it would have to be someone jerking my chain if they were getting removed. We have a high priced unix consultant here that told me that sort with the redirection causes a seperate process to occur and the redirection is asyncronous so he thought that the move was happening before the redirection flushed the buffers. He suggested that I could add a sleep 1 or rm x before the move and probably never have the problem again. Gill
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Bourne-again shell

Hi guys !! well i'm still new in learning UNIX , and actually i'm still studying it by myself .. anyway, some people told me the Bourne-again shell is a good version of UNIX to work on , and i tried to download yesterday but i didn't know how to start it ...... the ReadMe file associated with... (3 Replies)
Discussion started by: mrsamer
3 Replies

2. UNIX for Dummies Questions & Answers

IF THEN ELIF question in BOURNE SHELL

Hi, I get an error when executing this sample script. #!bin/sh if ; then echo "you need to enter the release as the first parameter" elif ; then echo "HI how are you ABC" echo "Hi how are you XYZ" echo " hi how are you all" else echo "using the $1 as input parameter" fi i get... (4 Replies)
Discussion started by: arun_st
4 Replies

3. Shell Programming and Scripting

Bourne Shell: if elsif question

Hi All, Must be something obvious I am missing, but the simple script below doesn't work. #!/bin/sh x=4 if then echo "x is $x" elsif then echo "x is greater than 4" else echo "x is less than 4" fi When I run this script, I get the error message: 7: Syntax error... (3 Replies)
Discussion started by: leostar_10
3 Replies

4. Shell Programming and Scripting

I need to understand the differences between the bash shell and the Bourne shell

I do not claim to be an expert, but I have done things with scripts that whole teams of folks have said can not be done. Of course they should have said we do not have the intestinal fortitude to git-r-done. I have been using UNIX actually HPUX since 1992. Unfortunately my old computer died and... (7 Replies)
Discussion started by: awk_sed_hello
7 Replies

5. Shell Programming and Scripting

How to activate Korn Shell functionnalities in Bourne Shell

Hi All I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell. Some operations like calculation don't work : cat ${file1} | tail -$((${num1}-${num2})) > ${file2} Is it possible to activate Korn Shell... (3 Replies)
Discussion started by: madmat
3 Replies

6. UNIX for Dummies Questions & Answers

Bourne-sh (not bash) question about nested loops and sed

Here's the input: alpha, numeric or alphanumeric string ("line 1 string") numeric string ("line 2 string") numeric string ("line 3 string") numeric string ("line 4 string") ... where - each numeric string is in a pattern that can be matched with RE but - there can be any number of... (2 Replies)
Discussion started by: uiop44
2 Replies

7. Shell Programming and Scripting

Bourne/C shell help

Exercise Five Write a Bourne shell script which: • Professionalism: plan for this from the start. • Has one command line argument. • If the command line argument is a directory then the script should output the number of files in the directory. • If the command line argument is an ordinary... (2 Replies)
Discussion started by: moesom
2 Replies

8. Shell Programming and Scripting

Bourne shell & Korn shell

Could some one tell me the difference btw Bourne shell and the Kshell? Which is more flexible and reliable in terms of portability and efficiency. When i type the following command .. $ echo $SHELL yields me /bin/sh Does this tells me that I am in Bourne shell. If yes, how can i get... (6 Replies)
Discussion started by: bobby1015
6 Replies

9. Shell Programming and Scripting

Timing the shell script

I have two shell scripts, one written with xargs for parallel processing (p1) and the other written in old school way (p3) . when I execute them, i get the below values. $ time ./p1 real 0m25.36s user 0m0.32s sys 0m0.80s $ time ./p3 real 0m23.25s user 0m6.20s sys ... (4 Replies)
Discussion started by: luhah
4 Replies

10. Cybersecurity

'Shell Shock' vulnerability in Bourne shell

A severe vulnerability was discovered in Bourne shell. Just google for: bash vulnerability ... for more details. (5 Replies)
Discussion started by: Cochise
5 Replies
MOVE_PAGES(2)						     Linux Programmer's Manual						     MOVE_PAGES(2)

NAME
move_pages - move individual pages of a process to another node SYNOPSIS
#include <numaif.h> long move_pages(int pid, unsigned long count, void **pages, const int *nodes, int *status, int flags); Link with -lnuma. DESCRIPTION
move_pages() moves the specified pages of the process pid to the memory nodes specified by nodes. The result of the move is reflected in status. The flags indicate constraints on the pages to be moved. pid is the ID of the process in which pages are to be moved. To move pages in another process, the caller must be privileged (CAP_SYS_NICE) or the real or effective user ID of the calling process must match the real or saved-set user ID of the target process. If pid is 0, then move_pages() moves pages of the calling process. count is the number of pages to move. It defines the size of the three arrays pages, nodes, and status. pages is an array of pointers to the pages that should be moved. These are pointers that should be aligned to page boundaries. Addresses are specified as seen by the process specified by pid. nodes is an array of integers that specify the desired location for each page. Each element in the array is a node number. nodes can also be NULL, in which case move_pages() does not move any pages but instead will return the node where each page currently resides, in the sta- tus array. Obtaining the status of each page may be necessary to determine pages that need to be moved. status is an array of integers that return the status of each page. The array only contains valid values if move_pages() did not return an error. flags specify what types of pages to move. MPOL_MF_MOVE means that only pages that are in exclusive use by the process are to be moved. MPOL_MF_MOVE_ALL means that pages shared between multiple processes can also be moved. The process must be privileged (CAP_SYS_NICE) to use MPOL_MF_MOVE_ALL. Page states in the status array The following values can be returned in each element of the status array. 0..MAX_NUMNODES Identifies the node on which the page resides. -EACCES The page is mapped by multiple processes and can only be moved if MPOL_MF_MOVE_ALL is specified. -EBUSY The page is currently busy and cannot be moved. Try again later. This occurs if a page is undergoing I/O or another kernel subsys- tem is holding a reference to the page. -EFAULT This is a zero page or the memory area is not mapped by the process. -EIO Unable to write back a page. The page has to be written back in order to move it since the page is dirty and the file system does not provide a migration function that would allow the move of dirty pages. -EINVAL A dirty page cannot be moved. The file system does not provide a migration function and has no ability to write back pages. -ENOENT The page is not present. -ENOMEM Unable to allocate memory on target node. RETURN VALUE
On success move_pages() returns zero. On error, it returns -1, and sets errno to indicate the error. ERRORS
E2BIG Too many pages to move. EACCES One of the target nodes is not allowed by the current cpuset. EFAULT Parameter array could not be accessed. EINVAL Flags other than MPOL_MF_MOVE and MPOL_MF_MOVE_ALL was specified or an attempt was made to migrate pages of a kernel thread. ENODEV One of the target nodes is not online. ENOENT No pages were found that require moving. All pages are either already on the target node, not present, had an invalid address or could not be moved because they were mapped by multiple processes. EPERM The caller specified MPOL_MF_MOVE_ALL without sufficient privileges (CAP_SYS_NICE). Or, the caller attempted to move pages of a process belonging to another user but did not have privilege to do so (CAP_SYS_NICE). ESRCH Process does not exist. VERSIONS
move_pages() first appeared on Linux in version 2.6.18. CONFORMING TO
This system call is Linux-specific. NOTES
For information on library support, see numa(7). Use get_mempolicy(2) with the MPOL_F_MEMS_ALLOWED flag to obtain the set of nodes that are allowed by the current cpuset. Note that this information is subject to change at any time by manual or automatic reconfiguration of the cpuset. Use of this function may result in pages whose location (node) violates the memory policy established for the specified addresses (See mbind(2)) and/or the specified process (See set_mempolicy(2)). That is, memory policy does not constrain the destination nodes used by move_pages(). The <numaif.h> header is not included with glibc, but requires installing libnuma-devel or a similar package. SEE ALSO
get_mempolicy(2), mbind(2), set_mempolicy(2), numa(3), numa_maps(5), cpuset(7), numa(7), migratepages(8), numa_stat(8) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2010-06-11 MOVE_PAGES(2)
All times are GMT -4. The time now is 08:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy