Sponsored Content
Full Discussion: bourne shell timing question
Top Forums UNIX for Dummies Questions & Answers bourne shell timing question Post 46940 by Perderabo on Thursday 29th of January 2004 12:26:47 PM
Old 01-29-2004
Quote:
Originally posted by gillbates
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
Redirection as you have done does not cause an extra process.

Redirection is not asyncronous with other elements of your script.

Redirection does not cause any buffers to be flushed.

If anything is in the buffer cache and not yet synced to disk, that is irrelevant. All i/o goes though the buffer cache anyway.

"rm x" to make y spring back into existence? Whoa.... I don't even know what to say about that.

"sleep 1" increases the window between the creation of the file and the time the mv needs it. This is likely to make the problem occur with greater frequency.
 

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
sync2(2)							System Calls Manual							  sync2(2)

NAME
sync2 - Flush file system metadata and data from memory buffers to disk SYNOPSIS
#include <sys/mount.h> int sync2 ( unsigned int POLICY , char *path); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: sync2(): XSH5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Flush the file system memory buffers to disk. The argument is one of the following: Flush all memory buffers. Specifying this flag causes the function to behave the same as the sync function. See sync(2). Flush all memory buffers except those under smooth sync control. The name of a file system or fileset. Specify the optional path parameter when you want to have the POLICY act only on that file system instead of all file systems. Specify a NULL argument when you want to have the POLICY act on all file systems. DESCRIPTION
The sync2 function causes file system data to be flushed (written) to disk. Which memory buffers are flushed to disk depends on the POLICY argument. If the policy is SYNC_SYNCPOLICY, all memory buffers are flushed to disk. If the policy is SYNC_SMOOTHSYNCPOLICY, all memory buffers except those under smooth sync control are flushed to disk. To which file systems the POLICY argument applies depends on the path argument. To apply the policy to one file system, name it in the path argument. To apply the policy to all file systems, specify the path argument as NULL. The writing, although scheduled, is not necessarily complete upon return from the sync2 function. RELATED INFORMATION
Functions: sync(2) Commands: sync(8) Standards: standards(5) delim off sync2(2)
All times are GMT -4. The time now is 06:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy