Hi,
Can you please help me with this one: I write an "if" statement, something like this:
if
then
echo "big file"
else
echo "normal file"
and I get an error: `'then is not expected
Thanks in advance (6 Replies)
Hi, can someone please tell me what is wrong with this code? I just want it to check if the file size is greater than 2000kb.
if
Thanks!
---------- Post updated at 09:23 PM ---------- Previous update was at 09:21 PM ----------
I should probably post the full code:
#!/bin/sh... (9 Replies)
I'm working on a function in a shell script I'm writing that will eventually take in and print out a list of vendor names and aliases (for my work) Here's the function in question:
addvendorandalias ()
{
echo
echo -n 'Would you like to create a new vendor list (y or n)? '
read answer... (3 Replies)
Guy's
I'm trying to create script to execute some critical commands in AIX
like the below ...
stopsrc -s qdaemon
stopsrc -s sshd
stopsrc -s lpd
stopsrc -s nfsd
I want between each command to ask me like this
" are you sure to stop qdaemon "
" are you sure to stop ssh"
" are... (3 Replies)
It saves me lot of typing and space/lines when I do not use full 'if' keyword and construct, instead use ..
&& <statement> || <statement>
that perfectly replaces..
if ; then
<statement>
else
<statement>
fi
Can I use following syntax when I want to add multiple statements under 'if'... (4 Replies)
Hi,
Is there a way to compare the value in if condition with a list of values.
eg . if ]
then
echo "it's a mammal"
else
echo "its not"
fi
Thanks! (8 Replies)
Hi
Can you please tell me what is wrong with this line:
if && ]; then
basically i want to check if x = 12 and F (Filename) end with 'g'. But it is throwing syntax error. (7 Replies)
I am getting the following error when I am running a script in ksh when trying to execute an if statement comparing two numerical values
tstmb.sh: 1.5321e+08: 0403-057 Syntax error
Below is my code snippet.
#!/bin/ksh
set -x
TODAY=$(date +%y%m%d)
for file in $(ls -rt *.log | tail... (11 Replies)
I want to make the file test condition a variable ($Prmshn in code below).
My goal is to use something like the first three unsuccessful if statetments since the 'if
#!/bin/ksh
test_input()
{
Prmshn=${1}
InFLNm=${2}
ifReq="-$Prmshn $InFLNm"
#the following three if statments fail:
#if ] ;... (10 Replies)
I'm new to unix and the command line and am trying to learn different commands. I have a file (teledir.txt) that contains a name and phone number for 3 different people. I am writing a script that is to take two positional parameters and I typed out how it should behave:
if <name and number... (1 Reply)
Discussion started by: Eric7giants
1 Replies
LEARN ABOUT OSX
mpi_file_get_view
MPI_File_get_view(3OpenMPI)MPI_File_get_view(3OpenMPI)NAME
MPI_File_get_view - Returns the process's view of data in the file.
SYNTAX
C Syntax
#include <mpi.h>
int MPI_File_get_view(MPI_File fh, MPI_Offset *disp,
MPI_Datatype *etype, MPI_Datatype *filetype,
char *datarep)
Fortran Syntax (see FORTRAN 77 NOTES)
INCLUDE 'mpif.h'
MPI_FILE_GET_VIEW(FH, DISP, ETYPE,
FILETYPE, DATAREP, IERROR)
INTEGER FH, ETYPE, FILETYPE, IERROR
CHARACTER*(*) DATAREP
INTEGER(KIND=MPI_OFFSET_KIND) DISP
C++ Syntax
#include <mpi.h>
void MPI::File::Get_view(MPI::Offset& disp,
MPI::Datatype& etype,
MPI::Datatype& filetype, char* datarep) const
INPUT PARAMETER
fh File handle (handle).
OUTPUT PARAMETERS
disp Displacement (integer).
etype Elementary data type (handle).
filetype File type (handle). See Restrictions, below.
datarep Data representation (string).
IERROR Fortran only: Error status (integer).
DESCRIPTION
The MPI_File_get_view routine returns the process's view of the data in the file. The current values of the displacement, etype, and file-
type are returned in disp, etype, and filetype, respectively.
The MPI_File_get_view interface allows the user to pass a data-representation string via the datarep argument.
FORTRAN 77 NOTES
The MPI standard prescribes portable Fortran syntax for the DISP argument only for Fortran 90. FORTRAN 77 users may use the non-portable
syntax.
INTEGER*MPI_OFFSET_KIND DISP
where MPI_OFFSET_KIND is a constant defined in mpif.h and gives the length of the declared integer in bytes.
ERRORS
Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. C++ func-
tions do not return errors. If the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism
will be used to throw an MPI:Exception object.
Before the error value is returned, the current MPI error handler is called. For MPI I/O function errors, the default error handler is set
to MPI_ERRORS_RETURN. The error handler may be changed with MPI_File_set_errhandler; the predefined error handler MPI_ERRORS_ARE_FATAL may
be used to make I/O errors fatal. Note that MPI does not guarantee that an MPI program can continue past an error.
Open MPI 1.2 September 2006 MPI_File_get_view(3OpenMPI)