/ linux スクリプト コマンド実行結果を変数にする
このエントリーに対する TrackBack URL

選択ボタンを押すとトラックバック(以下TB)URLが選択されるので,マウスの右クリックメニューや「Ctrl+C」 「command key+C」などでコピーしましょう。

linux スクリプト コマンド実行結果を変数にする

#!/bin/sh

#デバイスの数をカウント
no=`aplay -l | grep "カード" | awk '{print $2,$7,$8}' | wc -l`
    
#ハードウエアNo.にhw:を付加
dev1=`aplay -l | grep "カード" | awk '{print $2,$7,$8}' | awk -F":" '{print $1,$2}' | ¥
sed 's/デバイス //g' | sed 's/ /,/g' | sed 's/^/hw:/g'`
    
echo "$no"
echo "$dev1"

— posted by くま at 01:01 pm   pingTrackBack [0]

このエントリーに対する TrackBack URL

選択ボタンを押すとトラックバック(以下TB)URLが選択されるので,マウスの右クリックメニューや「Ctrl+C」 「command key+C」などでコピーしましょう。

<< 2014.10 >>
SMTWTFS
   1234
5678910 11
12131415161718
19 202122232425
262728293031 
 
























T: Y: ALL: Online:
ThemePanel
Created in 0.0297 sec.