UNIX батник
текстовым редактором
в досе помнится шаблон *.bat
пример файл hello.111:
#!/bin/bash
echo "Hello, this is a batch :)"
Права:
chmod u+x hello.111
Первая строка в файле указывает, какой интерпретатор читает и выполняет твои команды. В данном случае, это bash, находящийся в каталоге /usr/bin
он даже может не быть исполняемым, если запускать так:
sh filename
зачем тебе юникс?
./file.sh

я тоже уже два года не спрашиваю:)
а за советы спасибо.
не песдеть! UNIX офигенная система для ПК.да правильно, настоящие не_ламаки сидят на ней.
а за советы спасибо.

---
"Аллах не ведёт людей неверных."
Но всё время жалуешься, что не можешь выбрать.
и причём здесь execve (const char *filename, char *const argv[], char *const envp[]); ?
EXECVE(2) NetBSD System Calls Manual EXECVE(2)
NAME
execve -- execute a file
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <unistd.h>
int
execve(const char *path, char *const argv[], char *const envp[]);
DESCRIPTION
execve transforms the calling process into a new process. The new
process is constructed from an ordinary file, whose name is pointed to by
path, called the new process file. This file is either an executable
object file, or a file of data for an interpreter. An executable object
file consists of an identifying header, followed by pages of data repre-
senting the initial program (text) and initialized data pages. Addi-
tional pages may be specified by the header to be initialized with zero
data; see a.out(5).
An interpreter file begins with a line of the form:
#! interpreter [arg]
When an interpreter file is execved the system runs the specified
interpreter. If the optional arg is specified, it becomes the first
argument to the interpreter, and the name of the originally execved
file becomes the second argument; otherwise, the name of the originally
execved file becomes the first argument. The original arguments are
shifted over to become the subsequent arguments. The zeroth argument,
normally the name of the execved file, is left unchanged. The inter-
preter named by interpreter must not itself be an interpreter file.
---
"Аллах не ведёт людей неверных."
надо бантик в юниксе замутить. как?

я знаю, что делает эта функция. только мне кажется, что здесь разговор не про запуск скрипта из программы на С
An interpreter file begins with a line of the form:
#! interpreter [arg]
When an interpreter file is execved the system runs the specified
interpreter. If the optional arg is specified, it becomes the first
argument to the interpreter, and the name of the originally execved
file becomes the second argument; otherwise, the name of the originally
execved file becomes the first argument.
Тебе по буквам повторить?
---
"Аллах не ведёт людей неверных."
ну дык я уже и забыл, как про это можно не знать

ну дык я уже и забыл, как про это можно не знатьТак это с первого поста было ясно. Тут задача была проще.
Оставить комментарий
GAD_FATAL
надо батник в юниксе замутить. как?