タグ

shellに関するkomlowのブックマーク (19)

  • Writing Safe Shell Scripts

    Writing shell scripts leaves a lot of room to make mistakes, in ways that will cause your scripts to break on certain input, or (if some input is untrusted) open up security vulnerabilities. Here are some tips on how to make your shell scripts safer. Don't The simplest step is to avoid using shell at all. Many higher-level languages are both easier to write the code in in the first place, and avoi

    komlow
    komlow 2020/02/03
  • Build Your Own Shell using Rust

    Build Your Own Shell using Rust 2018-11-17 This is a tutorial on building your own shell using Rust, in the spirit of the build-your-own-x list. Creating a shell is a great way to understand how the shell, terminal emulator, and OS work together. What is a shell? A shell is a program which allows you to control your computer. It does this largely by making it easy to launch other applications. But

  • 分散シェルまとめ - Qiita

    昔社内で説明した、分散シェルについてのまとめ。どれも基的にパスワードなしログインができることが前提。使いドコロが結構違うので、それぞれ使い分けると吉。pdshはクラスタの監視とかgrepでの集計、csshxは緊急のクラスタの設定変更とかレシピ作る前の調査とかに、gxpはクラスタでのタスク分散実行に使うことが多い。 プロダクション構成では、可能な限り直接サーバに入ってこういう作業しなくて済むような環境を構築するのが望ましいけど、クソシステムに分け入って直したり障害対応する仕事は世の中いっぱいあるので、このご時世でも知っていると便利だとは思う。 pdshは複数のサーバに同時にssh接続して同時に同じコマンドを実行するための分散シェル。複数台のサーバのログを'tail -f'したり、ディレクトリの中身をまとめて表示したりするときに便利。 apiサーバのログを全台tail -fして以上が出てない

    分散シェルまとめ - Qiita
    komlow
    komlow 2017/04/03
  • UNIX & Linux コマンド・シェルスクリプト リファレンス

    目次 当サイトについて bash シェルスクリプト入門 -シェルスクリプトのいろは- コマンド Tips シェルスクリプト Tips 変数を使用する 配列を使用する 入力と出力 if 文と test コマンド for 文の使用方法 while 文の使用方法 case 文の使用方法 関数の使用方法 引数を処理する 終了ステータス シグナルと trap コマンド フィルタを使用した文字列操作 1 フィルタを使用した文字列操作 2 日付を取得する 文字コードと改行コード シェルスクリプトのデバッグ AWK リファレンス (Deprecated) シェルスクリプト ライブラリ 『ether.sh』 お知らせ Bluesky を始めました @sunone.me 変更履歴 2023.10.07 ページ内リンクを修正した。 2021.02.01 このサイトに「もう 1 ページ追加しよう」と思ってから、も

    UNIX & Linux コマンド・シェルスクリプト リファレンス
  • シェルスクリプトの書き方

    12月にTwitterに流れていたPOSIX何とかという話題を読んでいたらこの記事にたどり着いた。もう3年以上前の記事だけれど、内容がとても偏っていると思う。 シェルスクリプトの書き方について解説しているウェブ上の資料は少なく、当該記事も検索に引っかかりやすい。最近の初学者はまず検索して調べることが多いが、反論が検索に引っかからないとそれが正しいと受け入れてしまう可能性が高いように思う。きちんと反論している日語の記事が引っかからないので、あえて問題と思う点をまとめてみた。 そんなこと書いているあなたは誰? わたしはシェルスクリプトの専門家でも職業プログラマでもないけれど、シェルスクリプトを書いた量はそれなりにあると思う。環境はSunOS4, Solaris, HP-UX, IBM AIX, FreeBSD, OpenBSD, Linuxを経験していて、移植性や性能の問題がどこで発生しやす

    komlow
    komlow 2017/01/13
  • Googleの肩に乗ってShellコーディングしちゃおう - Qiita

    はじめに GoogleさんがShellスタイルガイドを共有していたので、いくつか気になった点をピックアップしました。 自分のShellスタイルはかなり我流なので、自省の意味も込めてコメントも併記します。 Googleスタイルガイドの元ネタ (Python/C++/Java/Rとかだけでなくdocumentガイドなど色々あります) https://github.com/google/styleguide Shellスタイルガイド (今回はこちら) http://google.github.io/styleguide/shell.xml 当は人間がチェックするのではなくcpplintのためXML定義なのかもですが、気にしない気にしない。 (見たところcpplintc++だけだと思ってます) commitフックでshell系のlint走らせろっていうのが今風なのかもしれませんが、キニシナイキ

    Googleの肩に乗ってShellコーディングしちゃおう - Qiita
    komlow
    komlow 2017/01/10
  • The Xonsh Shell

    XONSH is a Python-powered shell Xonsh is a Python-powered, cross-platform, Unix-gazing shell language and command prompt. The language is a superset of Python 3.6+ with additional shell primitives that you are used to from Bash and IPython. It works on all major systems including Linux, OSX, and Windows. Xonsh is meant for the daily use of experts and novices. Install Docs Github Donate What is Xo

    The Xonsh Shell
    komlow
    komlow 2016/05/11
  • シェルスクリプトを極める

    PostgreSQL16新機能紹介 - libpq接続ロード・バランシング(第41回PostgreSQLアンカンファレンス@オンライン 発表資料)NTT DATA Technology & Innovation

    シェルスクリプトを極める
    komlow
    komlow 2014/12/30
  • Big Sky :: kill で立つハッカー、シェルを濁す

    shell - 立つハッカー、シェルを濁さず - Qiita おことわり このTipsは不作法だとして異論が出るかもしれないが、私自身がよくやるのでここで公開してみる。それは一体何かというと…… コマンドヒストリーが残るのイヤだ! と思うことってよくないだろうか... http://qiita.com/richmikan@github/items/2c90ddb778a7d4948324 man bash によると HISTFILE The name of the file in which command history is saved (see HIS‐ TORY below).  The default value is ~/.bash_history.   If  unset, the  command  history  is  not  saved  when an inte

    Big Sky :: kill で立つハッカー、シェルを濁す
    komlow
    komlow 2014/09/01
  • シェルスクリプトを公開するとき, コマンド前にバックスラッシュをつけるべき - Shohei Yoshida's Diary

    oh-my-zsh の環境で、peco-select-history が動かない - Qiita 追記 2014年 7月 7日 シェルスクリプトと書いてしまい漠然すぎましたが, ここで述べている ことが問題になるのは, .bashrc, .zshrcに関数, alias設定等がコピー される場合や, sourceコマンドでファイルを読み込む場合です. non-interactiveに実行されるシェルスクリプトについては特に 問題ないです. 問題点 そうしないと, 公開されたコマンドを自分の環境に導入した場合, aliasにより正しく動かなく場合があるためです. aliasをつけがちな コマンド(ls, grep等)がシェルスクリプトに含まれていると 特に問題が起こる可能性が高くなります. 例 pecoを使って カレントディレクトリのファイルをページャで開く 例を考えてみましょう. 単純に考

    シェルスクリプトを公開するとき, コマンド前にバックスラッシュをつけるべき - Shohei Yoshida's Diary
    komlow
    komlow 2014/07/03
  • サイト閉鎖のお知らせ | ASCII Books

    ASCII Booksのサイトをご利用いただき、ありがとうございます。 2016年12月6日をもちまして、サイトを閉鎖させていただくことになりました。 今までサイトをご利用いただき、ありがとうございました。 アスキー・メディアワークスを引き続き、よろしくお願いいたします。

    komlow
    komlow 2014/06/06
    “フルスクラッチから1日でCMSを作る”ヤバそう
  • The 3 Good Habits for Shell Beginners

    「シェル苦手な人に、今日から始めて欲しい3つの考え方」 @nanapi勉強会 vol2 - Shellの活用でこれだけ毎日が便利になる http://nanapi.doorkeeper.jp/events/11514

    The 3 Good Habits for Shell Beginners
    komlow
    komlow 2014/05/29
  • https://qiita.com/geta6/items/199faca823e84026c10a

    komlow
    komlow 2013/12/23
  • fish shell

    Finally, a command line shell for the 90s fish is a smart and user-friendly command line shell for Linux, macOS, and the rest of the family. fish will delight you with features like tab completions and syntax highlighting that just work. It will make you exclaim "Of course fish does that!".

  • 30 Handy Bash Shell Aliases For Linux / Unix / MacOS

    nixCraft → Tutorials → Linux → Awesome bash aliases for Linux and Unix users to increase productivity An bash shell alias is nothing but the shortcut to commands. The alias command allows the user to launch any command or group of commands (including options and filenames) by entering a single word. Use alias command to display a list of all defined aliases. You can add user-defined aliases to ~/.

    30 Handy Bash Shell Aliases For Linux / Unix / MacOS
    komlow
    komlow 2012/08/31
    便利
  • shell script を書くときの tips 2つ(初心者向け) - tokuhirom's blog

    shell script は普段さけて通りたいと願ってやまないわけですが、たまには書かないといけないことがあるので、そういうときは覚えておくと便利な tips を2つ。 autodie っぽくするset -eとすると、コマンドの実行に失敗したときにそこで実行がとまるので便利。 #!/bin/sh set -e perl -e 'die' echo SHOULD NOT REACH HEREとすると % ./hoge.sh Died at -e line 1. % echo $? 255となって、最後までいかずに死にます。 複数のコマンドを順番に実行するときに便利。 なお、以下のような挙動をするんだそうです。 ただし失敗したコマンドが until または while ループの一部である、 if 文の一部である、 && または || リストの一部である、 コマンドの返り値が ! で反転されてい

    komlow
    komlow 2012/07/24
  • tanasinn terminal emurator

    Geckoベースのユーザーインターフェース (HTML Canvas + XUL)。柔軟でカスタマイズが容易です。 マルチプラットフォーム。現在サポートされるのは、Mac / FreeBSD / Linux(というかUbuntu) / Windows(XP/Vista/7) + Cygwin環境 (POSIX版Pythonが必要) プラグインアーキテクチャ。プラグアンドプレイでのインストール・アンインストールが可能。 ブラウザを再起動したり閉じたりしている間、ターミナルセッションを保持します。 サスペンドしたセッションに後から再接続できます。 デバッガ内臓。ステップ実行やトレースができます。 ターミナルとアプリケーションがやり取りするI/Oシーケンスをリアルタイムで観察できます。 スクロールバック、代替スクリーン、ビジュアルベル、オーディオベルなど基的な機能はサポートしています。 IME

  • Zsh is your friend - Mike Grouchys Blog

    Zsh is your friendI don't know if you know this, but ZShell is your friend, you might not know it yet, but its true. I know what you are thinking , "whats wrong with Bash?", nothing, except its not Zsh. Its not that Bash is a bad guy, I don't want to put him down, but if we were picking teams, Bash would be last picked in gym class. He isn't very versatile and he doesn't do anything particularly g

    Zsh is your friend - Mike Grouchys Blog
  • Relational shell programming

    Relational algebra is a theory for manipulating relations whose power is equivalent to SQL and relational calculus. Remarkably, relational algebra has only six primitive operations. I define the six primitives below, but if you're looking for a comprehensive work on relational theory, particularly as it relates to modern databases, I recommend Date's SQL and Relational Theory: Relations in Unix Ma

  • 1