Skip to content

C言語のexecveシステムコールの練習に使用

License

Notifications You must be signed in to change notification settings

shu1oka28/execve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

execve

execveシステムコールを用いたコマンドを呼び出すプログラム

インストール方法

Ubuntuを想定

sudo apt install git gcc
git clone https://github.com/shu1oka28/execve.git
gcc -Wall -Wextra run.c

使い方

$ ./a.out
commnand> /usr/bin/git add -A
commnand> /usr/bin/git status
On branch main
Your branch is up to date with 'origin/main'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   README.md
	modified:   run.c

$ ./a.out
commnand> /usr/bin/date
Fri Sep 17 20:34:20 JST 2021
commnand> /usr/bin/git status
On branch main
Your branch is up to date with 'origin/main'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	modified:   README.md
	modified:   run.c

commnand> ./a.out
commnand> cat         
catコマンドが実行できませんでした
error in execve: : No such file or directory
commnand> (^D)commnand> (^D)

(^D)はCtrl+Dを押したことを示しており、実際は表示されません。

About

C言語のexecveシステムコールの練習に使用

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages