Run shell script from C program by calling fork and execl
I need to write a c program that uses the fork and excel system calls to run the shell script mode invoked like this: "./mode 644 ls -l" (that is the argumetns will always be 644 ls -l)
here's the mode script:
here's my c program:
I don't get how to use fork and excel really?
Hi,
I just tried to call a simple script from a pretty simple C program. I could not succeed :-( a message was thrown saying
"sh: line 1: "Script name with path": Permission denied"
The C program and shell script are below, both are in the same directory and shell script is given... (7 Replies)
suppose have different files
1.1
2.2
3.3
4.4
5.5
All the files have to run under the same command say
tr -d '\n'
so how to run all the files under the same command by using shell script (3 Replies)
Hi,
I have a K shell
a.ksh
function abc {
// Some logic
}
In
b.ksh
i have included the a.ksh
./a.ksh
I want to call the abc function from this b.ksh script.
Thanks
Vijay (2 Replies)
Hi all,
I need to call some script (s1) from within my shell script (s2). s1 accepts parameters and I want to feed it with values of params from my script. I tried many things but none work (I am so much of a beginner), please help
one of my attempts :
.
.
.
param1="hehe"
param2="haha"
... (12 Replies)
Hi,
I have a shell script which connects to a database and fetches the count of the records from a table. I want to embed this whole script in a C program. Also the count fetched should be available in the C program for further usage.
Please let me know how this can be done.
Thanks
... (0 Replies)
Hi,
I have a shell script which connects to a database and fetches the count of the records from a table. I want to embed this whole script in a C program. Also the count fetched should be available in the C program for further usage.
Please let me know how this can be done.
Thanks (9 Replies)
Hello
I am trying to run a python program using shell script, which takes a single argument from a file.
This file has one entry per line :
1aaa
2bbb
3ccc
4ddd
5eee
...
...
...
My shell script runs the program, only for the last entry :
#!/bin/sh
IFS=$'\n'
for line in $(cat... (2 Replies)
Hi all,
I have the following Perl script which is intended to run a Shell script and generate some logging for the purposes of tracking weather or not the script ran.
I get an error, of course, since I don't know what I'm doing really.
Here is the code:
#!/opt/perl/bin/perl -w
... (14 Replies)
Hi All,
We have a requirement to Integrate Cyber-Ark with Informatica .
Basically cyberark will contain the username and password for Database.
First step will be
1)In shell Script run curl command calling cyber-Ark RESTAPI requesting the credentials and store the secret in a variable.
... (0 Replies)
Discussion started by: Praveena9102
0 Replies
LEARN ABOUT BSD
mkproto
MKPROTO(8) System Manager's Manual MKPROTO(8)NAME
mkproto - construct a prototype file system
SYNOPSIS
/usr/sbin/mkproto special proto
DESCRIPTION
Mkproto is used to bootstrap a new file system. First a new file system is created using newfs(8). Mkproto is then used to copy files
from the old file system into the new file system according to the directions found in the prototype file proto. The prototype file con-
tains tokens separated by spaces or new lines. The first tokens comprise the specification for the root directory. File specifications
consist of tokens giving the mode, the user-id, the group id, and the initial contents of the file. The syntax of the contents field
depends on the mode.
The mode token for a file is a 6 character string. The first character specifies the type of the file. (The characters -bcd specify regu-
lar, block special, character special and directory files respectively.) The second character of the type is either u or - to specify set-
user-id mode or not. The third is g or - for the set-group-id mode. The rest of the mode is a three digit octal number giving the owner,
group, and other read, write, execute permissions, see chmod(1).
Two decimal number tokens come after the mode; they specify the user and group ID's of the owner of the file.
If the file is a regular file, the next token is a pathname whence the contents and size are copied.
If the file is a block or character special file, two decimal number tokens follow which give the major and minor device numbers.
If the file is a directory, mkproto makes the entries . and .. and then reads a list of names and (recursively) file specifications for
the entries in the directory. The scan is terminated with the token $.
A sample prototype specification follows:
d--777 3 1
usr d--777 3 1
sh ---755 3 1 /bin/sh
ken d--755 6 1
$
b0 b--644 3 1 0 0
c0 c--644 3 1 0 0
$
$
SEE ALSO fs(5), dir(5), fsck(8), newfs(8)BUGS
There should be some way to specify links.
There should be some way to specify bad blocks.
Mkproto can only be run on virgin file systems. It should be possible to copy files into existent file systems.
Mkproto can only copy files up to a single level indirect less 4kb. This works out to about 252Kb
4.2 Berkeley Distribution November 17, 1996 MKPROTO(8)