블로그 이미지
훅크선장

카테고리

분류 전체보기 (362)
사진이야기 (23)
펭귄컴퓨팅 (121)
컴퓨터보안 (84)
절름발이 프로그래머 (59)
하드웨어개조 (23)
멀알려줄까 (35)
홈베이킹&홈쿠킹 (2)
잡다한것들 (15)
Total
Today
Yesterday

달력

« » 2024.4
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

공지사항

태그목록

최근에 올라온 글

참조 : https://www.ostechnix.com/bat-a-cat-clone-with-syntax-highlighting-and-git-integration/

 

Bat - A Cat Clone With Syntax Highlighting And Git Integration

Bat command is a clone to the cat command, with some additional cool features such as syntax highlighting, git integration and automatic paging etc.

www.ostechnix.com

리눅스에서의 cat 명령어를 대체하는  rust 기반의 bat 이라는 명령어를 설치하는 과정입니다.

 

1. 먼저 rust 환경을 설치합니다.

# curl https://sh.rustup.rs -sSf |sh

# source $HOME/.cargo/env

 

2. 필요 패키지 설치

# yum install clang

 

3. bat 빌드와 설치 

# cargo install bat

 

-----------------------------------------------------------------------------------------

실제 진행상황

[root@server ~]# curl https://sh.rustup.rs -sSf |sh

info: downloading installer

 

Welcome to Rust!

 

This will download and install the official compiler for the Rust

programming language, and its package manager, Cargo.

 

It will add the cargo, rustc, rustup and other commands to

Cargo's bin directory, located at:

 

  /root/.cargo/bin

 

This can be modified with the CARGO_HOME environment variable.

 

Rustup metadata and toolchains will be installed into the Rustup

home directory, located at:

 

  /root/.rustup

 

This can be modified with the RUSTUP_HOME environment variable.

 

This path will then be added to your PATH environment variable by

modifying the profile files located at:

 

  /root/.profile

/root/.bash_profile

 

You can uninstall at any time with rustup self uninstall and

these changes will be reverted.

 

Current installation options:

 

 

   default host triple: x86_64-unknown-linux-gnu

     default toolchain: stable

               profile: default

  modify PATH variable: yes

 

1) Proceed with installation (default)

2) Customize installation

3) Cancel installation

>1

 

info: profile set to 'default'

info: default host triple is x86_64-unknown-linux-gnu

info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'

info: latest update on 2020-03-12, rust version 1.42.0 (b8cedc004 2020-03-09)

info: downloading component 'cargo'

info: downloading component 'clippy'

info: downloading component 'rust-docs'

 12.0 MiB /  12.0 MiB (100 %)  11.1 MiB/s in  1s ETA:  0s

info: downloading component 'rust-std'

 17.1 MiB /  17.1 MiB (100 %)  10.9 MiB/s in  1s ETA:  0s

info: downloading component 'rustc'

 58.6 MiB /  58.6 MiB (100 %)  11.1 MiB/s in  5s ETA:  0s

info: downloading component 'rustfmt'

info: installing component 'cargo'

info: installing component 'clippy'

info: installing component 'rust-docs'

 12.0 MiB /  12.0 MiB (100 %)   7.4 MiB/s in  1s ETA:  0s

info: installing component 'rust-std'

 17.1 MiB /  17.1 MiB (100 %)  11.8 MiB/s in  1s ETA:  0s

info: installing component 'rustc'

 58.6 MiB /  58.6 MiB (100 %)  11.5 MiB/s in  5s ETA:  0s

info: installing component 'rustfmt'

info: default toolchain set to 'stable'

 

  stable installed - rustc 1.42.0 (b8cedc004 2020-03-09)

 

 

Rust is installed now. Great!

 

To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH

environment variable. Next time you log in this will be done

automatically.

 

To configure your current shell run source $HOME/.cargo/env

[root@server ~]# source $HOME/.cargo/env

[root@server ~]# yum install

clang

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

 * base: mirror.kakao.com

 * extras: mirror.kakao.com

 * updates: mirror.kakao.com

Resolving Dependencies

--> Running transaction check

---> Package clang.x86_64 0:3.4.2-8.el7 will be installed

--> Processing Dependency: llvm(x86-64) = 3.4.2-8.el7 for package: clang-3.4.2-8.el7.x86_64

--> Processing Dependency: libLLVM-3.4.so()(64bit) for package: clang-3.4.2-8.el7.x86_64

--> Running transaction check

---> Package llvm.x86_64 0:3.4.2-8.el7 will be installed

---> Package llvm-libs.x86_64 0:3.4.2-8.el7 will be installed

--> Finished Dependency Resolution

 

Dependencies Resolved

 

=================================================================================================================================================

 Package                            Arch                            Version                                Repository                       Size

=================================================================================================================================================

Installing:

 clang                              x86_64                          3.4.2-8.el7                            extras                           19 M

Installing for dependencies:

 llvm                               x86_64                          3.4.2-8.el7                            extras                          1.3 M

 llvm-libs                          x86_64                          3.4.2-8.el7                            extras                          7.6 M

 

Transaction Summary

=================================================================================================================================================

Install  1 Package (+2 Dependent packages)

 

Total download size: 28 M

Installed size: 93 M

Is this ok [y/d/N]: y

Downloading packages:

(1/3): llvm-libs-3.4.2-8.el7.x86_64.rpm                                                                                   | 7.6 MB  00:00:01     

(2/3): llvm-3.4.2-8.el7.x86_64.rpm                                                                                        | 1.3 MB  00:00:01     

(3/3): clang-3.4.2-8.el7.x86_64.rpm                                                                                       |  19 MB  00:00:03     

-------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                            8.6 MB/s |  28 MB  00:00:03     

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : llvm-libs-3.4.2-8.el7.x86_64                                                                                                  1/3 

  Installing : llvm-3.4.2-8.el7.x86_64                                                                                                       2/3 

  Installing : clang-3.4.2-8.el7.x86_64                                                                                                      3/3 

  Verifying  : clang-3.4.2-8.el7.x86_64                                                                                                      1/3 

  Verifying  : llvm-libs-3.4.2-8.el7.x86_64                                                                                                  2/3 

  Verifying  : llvm-3.4.2-8.el7.x86_64                                                                                                       3/3 

 

Installed:

  clang.x86_64 0:3.4.2-8.el7                                                                                                                     

 

Dependency Installed:

  llvm.x86_64 0:3.4.2-8.el7                                            llvm-libs.x86_64 0:3.4.2-8.el7                                           

 

Complete!

[root@server ~]# cargo install bat

    Updating crates.io index

  Installing bat v0.13.0

   Compiling libc v0.2.69

   Compiling memchr v2.3.3

   Compiling proc-macro2 v1.0.10

   Compiling unicode-xid v0.2.0

   Compiling cfg-if v0.1.10

   Compiling syn v1.0.17

   Compiling proc-macro2 v0.4.30

   Compiling lazy_static v1.4.0

   Compiling unicode-xid v0.1.0

   Compiling autocfg v1.0.0

   Compiling serde v1.0.106

   Compiling regex-syntax v0.6.17

   Compiling byteorder v1.3.4

   Compiling bitflags v1.2.1

   Compiling pkg-config v0.3.17

   Compiling log v0.4.8

   Compiling unicode-width v0.1.7

   Compiling version_check v0.1.5

   Compiling glob v0.3.0

   Compiling ucd-trie v0.1.3

   Compiling matches v0.1.8

   Compiling rustc-demangle v0.1.16

   Compiling vec_map v0.8.1

   Compiling ansi_term v0.11.0

   Compiling quick-error v1.2.3

   Compiling strsim v0.8.0

   Compiling smallvec v1.3.0

   Compiling maplit v1.0.2

   Compiling either v1.5.3

   Compiling bindgen v0.50.1

   Compiling syn v0.15.44

   Compiling liquid-error v0.19.0

   Compiling termcolor v1.1.0

   Compiling shlex v0.1.1

   Compiling proc-macro-hack v0.5.15

   Compiling encoding_index_tests v0.1.4

   Compiling peeking_take_while v0.1.2

   Compiling anymap v0.12.1

   Compiling doc-comment v0.3.3

   Compiling crc32fast v1.2.0

   Compiling percent-encoding v1.0.1

   Compiling ryu v1.0.3

   Compiling version_check v0.9.1

   Compiling adler32 v1.0.4

   Compiling deunicode v1.1.0

   Compiling unicode-segmentation v1.6.0

   Compiling safemem v0.3.3

   Compiling itoa v0.4.5

   Compiling percent-encoding v2.1.0

   Compiling xml-rs v0.8.2

   Compiling same-file v1.0.6

   Compiling linked-hash-map v0.5.2

   Compiling fnv v1.0.6

   Compiling lazycell v1.2.1

   Compiling ansi_term v0.12.1

   Compiling shell-words v0.1.0

   Compiling wild v2.0.2

   Compiling unicode-bidi v0.3.4

   Compiling encoding-index-singlebyte v1.20141219.5

   Compiling encoding-index-japanese v1.20141219.5

   Compiling encoding-index-simpchinese v1.20141219.5

   Compiling encoding-index-tradchinese v1.20141219.5

   Compiling encoding-index-korean v1.20141219.5

   Compiling thread_local v1.0.1

   Compiling humantime v1.3.0

   Compiling line-wrap v0.1.1

   Compiling miniz_oxide v0.3.6

   Compiling pest v2.1.3

   Compiling walkdir v2.3.1

   Compiling itertools v0.8.2

   Compiling unicode-normalization v0.1.12

   Compiling yaml-rust v0.4.3

   Compiling encoding v0.2.33

   Compiling aho-corasick v0.7.10

   Compiling bstr v0.2.12

   Compiling content_inspector v0.2.4

   Compiling num-traits v0.2.11

   Compiling num-integer v0.1.42

   Compiling quote v0.6.13

   Compiling nom v4.2.3

   Compiling error-chain v0.12.2

   Compiling quote v1.0.3

   Compiling idna v0.1.5

   Compiling idna v0.2.0

   Compiling clang-sys v0.28.1

   Compiling fxhash v0.2.1

   Compiling base64 v0.10.1

   Compiling pest_meta v2.1.3

   Compiling jobserver v0.1.21

   Compiling atty v0.2.14

   Compiling term_size v0.3.1

   Compiling time v0.1.42

   Compiling flate2 v1.0.14

   Compiling termios v0.3.2

   Compiling clicolors-control v1.0.1

   Compiling dirs-sys v0.3.4

   Compiling textwrap v0.11.0

   Compiling cc v1.0.50

   Compiling url v1.7.2

   Compiling dirs v2.0.2

   Compiling url v2.1.1

   Compiling clap v2.33.0

   Compiling cexpr v0.3.6

   Compiling regex v1.3.6

   Compiling chrono v0.4.11

   Compiling proc-quote-impl v0.2.2

   Compiling pest_generator v2.1.3

   Compiling env_logger v0.6.2

   Compiling console v0.10.0

   Compiling globset v0.4.5

   Compiling proc-quote v0.2.2

   Compiling backtrace-sys v0.1.35

   Compiling libloading v0.5.2

   Compiling libz-sys v1.0.25

   Compiling libgit2-sys v0.12.3+1.0.0

   Compiling ansi_colours v1.0.1

   Compiling serde_derive v1.0.106

   Compiling backtrace v0.3.46

   Compiling pest_derive v2.1.0

   Compiling failure v0.1.7

   Compiling which v2.0.1

   Compiling git2 v0.13.2

   Compiling onig_sys v69.2.0

   Compiling onig v5.0.0

   Compiling liquid-value v0.19.1

   Compiling serde_json v1.0.51

   Compiling plist v0.4.2

   Compiling bincode v1.2.1

   Compiling liquid-interpreter v0.19.0

   Compiling liquid-compiler v0.19.0

   Compiling syntect v3.3.0

   Compiling liquid-derive v0.19.0

   Compiling liquid v0.19.0

   Compiling bat v0.13.0

    Finished release [optimized] target(s) in 1m 43s

  Installing /root/.cargo/bin/bat

   Installed package `bat v0.13.0` (executable `bat`)

[root@server ~]#

 

Posted by 훅크선장
, |