A good place to start is simple variable passing....
Passing variables from one script to another
The next level is passing a variable into a more complex command such as using a variable in a sed command. There are some simple quoting techniques that are very general. These are mentioned... (0 Replies)
I am having a shell script which has to be called from a C program. I have to pass two parameters to this script. HOw can I do that?
eg:
int main()
{
char st1;
char str2;
// call a shell script
call_sh(str1,str2) where call_sh is the name of the shell script.
then i need to get the return... (5 Replies)
hi,
i am passing around 14 parameters for a script
a=$1
b=$2
c=$3
d=$4
e=$5
f=$6
g=$7
h=$8
i=\"${9}\"
shift
j=\"${1}\"
still for j it is displaying the 1st parameter value..how to make it take the 10th parameter (2 Replies)
Hello,
I have two files that have delimited entries as shown below. I would like to use either Perl or Shell script to extract all the rows in File 1 corresponding to values in File 2 and output it to another File.
File 1
-------
1 36 24 Object1
2 45 36 Object2
3 96 ... (1 Reply)
Hi
I would like to use tar cmd in my script.
I have a variable with filenames, e.g. 1000 records and I would like to paste its values into tar cmd.
For this example I used three elements variable strings.
strings="file1.txt file2.txt file3.txt"
`tar cf file1.tar $strings`
Whether... (1 Reply)
Hello,
I have a shell script "Test.ksh" and I need to pass 8 parameters/arguments while executing the script
./Test.ksh 1 2 3 4 5 6 7 8
Out of these I want first 3 to be compulsory and rest 5 to be optional. Can you suggest the way to do this like and also how to pass these optional... (3 Replies)
I have an for loop that reads the following file
cat param.cfg
val1:env1:opt1
val2:env2:opt2
val3:env3:opt3
val4:env4:opt4
.
.
The for loop extracts the each line of the file so that at any one point, the value of i is
val1:env1:opt1 etc...
I would like to extract each... (19 Replies)
Hi Guru's,
I am new to shell scripting. I have a unique requirement:
The system generates a single pdf(/tmp/ABC.pdf) file with Invoices for Multiple Customers, the format is something like this:
Page1 >> Customer 1 >>Invoice1 + invoice 2 >> Page1 end
Page2 >> Customer 2 >>Invoice 3 + Invoice 4... (3 Replies)
Hello
I have a file like this:
> cat examplefile
ghi|NN603762|eee
mno|NN607265|ttt
pqr|NN613879|yyy
stu|NN615002|uuu
jkl|NN607265|rrr
vwx|NN615002|iii
yzA|NN618555|ooo
def|NN190486|www
BCD|NN628717|ppp
abc|NN190486|qqq
EFG|NN628717|aaa
HIJ|NN628717|sss
>
I can sort the file by... (5 Replies)
Hi,
Is there a special positional variables for when using the dot (.)?
Scripts are as below:
$: head -100 x.ksh /tmp/y.ksh
==> x.ksh <==
#!/bin/ksh
#
. /tmp/y.ksh 1234 abcd
echo "yvar1 = $yvar1"
echo "yvar2 = $yvar2"
==> /tmp/y.ksh <==
#!/bin/ksh (2 Replies)
Discussion started by: newbie_01
2 Replies
LEARN ABOUT NETBSD
syscall
SYSCALL(2) BSD System Calls Manual SYSCALL(2)NAME
syscall, __syscall -- indirect system call
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/syscall.h>
#include <unistd.h>
int
syscall(int number, ...);
quad_t
__syscall(quad_t number, ...);
DESCRIPTION
syscall() performs the system call whose assembly language interface has the specified number with the specified arguments. Symbolic con-
stants for system calls can be found in the header file <sys/syscall.h>. The __syscall form should be used when one or more of the parame-
ters is a 64-bit argument to ensure that argument alignment is correct.
This system call is useful for testing new system calls that do not have entries in the C library. It should not be used in normal applica-
tions.
RETURN VALUES
The return values are defined by the system call being invoked. In general, a 0 return value indicates success. A -1 return value indicates
an error, and an error code is stored in errno.
HISTORY
The syscall() function call appeared in 4.0BSD.
BUGS
There is no way to simulate system calls that have multiple return values such as pipe(2).
Since architectures return 32 bit and 64 bit results in different registers, it may be impossible to portably convert the result of
__syscall() to a 32bit value. For instance sparc returns 32 bit values in %o0 and 64 bit values in %o0:%o1 (with %o0 containing the most
significant part) so a 32 bit right shift of the result is needed to get a correct 32 bit result.
Many architectures mask off the unwanted high bits of the syscall number, rather than returning an error.
Due to ABI implementation differences in passing struct or union type arguments to system calls between different processors, all system
calls pass instead pointers to such structs or unions, even when the documentation of the system call mentions otherwise. The conversion
between passing structs and unions is handled normally via userland stubs. The correct arguments for the kernel entry points for each system
call can be found in the header file <sys/syscallargs.h>
BSD August 7, 2009 BSD