B! 33 0 0 0 sedを使って文字列を変換する際、 Mac等BSD系sedだと変換後に改行を出すのが一筋縄ではいかない、と言う話。 GNU sedでの改行変換 BSD sedでの改行出力 BSD sedでのスマートな改行出力 おまけ おまけ2 GNU sedでの改行変換 環境: Linux Bash 4.2.37 GNU sed version 4.2.1 GNU sedでは改行の出力は\nを指定してあげるだけで出来ます。 $ echo "aaa\nbbb"|sed "s/\\\\n/\n/" aaa bbb 入力の方の\nを実際の改行文字に変えたいような場合、 出力側に\nを指定してあげれば良いだけです 1。 BSD sedでの改行出力 環境: Mac Bash 4.3.24 BSD sed (May 10, 2005, バージョンの見方が分からない。。。) 同じコマンドを打って
love these blog posts? support my tools & writing on patreon! Mahalo :) Background In case you haven't heard the news, there is a massive security flaw which affects the latest version of macOS (High Sierra). The bug allows anybody to log into the root account with a blank, or password of their choosing. Yikes! Apparently this vulnerability was first posted, rather innocuously, to Apple's very own
C++ in Xcode Tired of Vim? Here's tips for C++ development in Xcode. Tuned to the needs of many classes at UM. Contents: Creating the Project Command Line Arguments Input Redirection - stdin Input and Output files - fstream Debugging Source Control Testing on CAEN Creating the Project After opening Xcode, go to File->New->Project In the OS X section, select 'Application' and then select the 'Comma
最近、Mac OS X(Marvericks)のターミナル上で、C言語を使って開発しています。その場合、Xcodeを使ってやるのが環境構築するのが一番簡単です。 ただターミナル上、あるいは、EclipseやNetBeansでやる場合には、コマンドを入力する必要があります。 このとき、gccは普通に使えるのですが、gdbがありません。その代わり、デバッグには、lldbを使います。lldbの使い方は、以下より。 LLDB Tutorial http://lldb.llvm.org/tutorial.html 簡単にまとめると、以下の通り。 まず、コンパイル時に、デバッグオプション(-g)を追加。 gcc -Wall -O2 -g -c hoge.c 起動時に実行ファイルを指定してlldbを実行。 lldb ./appfile 実行するには「r」(または「run」)をタイプします。これだけで、落
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く