uspTukubaiコマンドに関する様々な資料がここにあります。

 

 

魂内検索

DOCUMENTS

COMMAND

FORUM

UEC DOCS

VIDEO

 

Alphabetical list

(Video materials in preparation)

itouch(USP)

Name

itouch : Initializes a file

Synopsis

Usage   : itouch [-<n>] <string> <file1> <file2>...

        : itouch [-<n>] -f <file> <file1> <file2>...

Version : Tue Jan  9 09:02:34 JST 2024

Edition : 1

Description

If the specified file is not found or is zero bytes, then its

contents are initialized with <string> or <file>.

If -<n> is specified as a number, then the file is initialized with

<n> lines of <string> or <n> times of <file>.

You can specify multiple files.

If the file exists and is larger than zero bytes, the command does

nothing.

If the file specified is "-" then the command reads standard input

and will output to standard output.

Example 1

$ cat file

cat: file: No such file or directory  <-- File doesn't exist

$ itouch '000 000 0' file

$ cat file

000 000 0                     <-- Initialized with a string

$ itouch 'abc abc 0' file             <-- File exists and is not

$ cat file                     empty

000 000 0

Example 2

$ : > file

$ itouch -3 '000 000 0' file          <-- 3 lines initialized

$ cat file

000 000 0

000 000 0

000 000 0

Example 3

$ : > file

$ itouch 'a\nb\nc' file               <-- '\n' is converted to

$ cat file                     newline

a

b

c

Example 4

$ cat file1

$ cat file1 | itouch '000 0' -           <-- Empty file is read from

000 0                     standard input

$ cat file2

ABC D

$ cat file2 | itouch '000 0' -           <-- A file with content is

ABC D                     read from standard input

ABC D

Example 5

$ : > file

$ echo abc > init       <-- "init" is an initialization file.

$ itouch -f init file   <-- "file" is initialized by "init" file.

$ cat file

abc