2017年9月22日 星期五

ubuntu 14.04.4 Make install step by step

make help Prerequisites : Ubuntu 12.04 LTS - 32bits, ex:lsb_release -a Cross-compile : arm-linux-gnu-gcc 4.x.x Shell Environment : bash , ex:sudo dpkg-reconfigure dash - select No Tool Install : 1.genext2fs 2.mkimage [u-boot] 3.genromfs 4.make version 3.81 5.file version 5.0 upper 6.sudo apt-get install lzop 7.sudo apt-get install libncurses5-dev liblz4-tool xmlto cramfsprogs squashfs-tools 8.sudo apt-get install texinfo 9.sudo apt-get install openssl libssl-dev [version 1.0.1] 10.sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0



tar解壓失败:gzip: stdin: not in gzip format
****解壓縮:tar xvf -f filename.tar.bz2欲解壓縮的目錄*****
如出現上方解壓失敗 ,依紅色字體步驟方式。





2017年9月3日 星期日

bash script array sample

To declare an array in bash

Declare and an array called array and assign three values:
array=( one two three )
More examples:
files=( "/etc/passwd" "/etc/group" "/etc/hosts" )
limits=( 10, 20, 26, 39, 48)
To print an array use:
printf "%s\n" "${array[@]}"
printf "%s\n" "${files[@]}"
printf "%s\n" "${limits[@]}"

To Iterate Through Array Values

Use for loop syntax as follows:
for i in "${arrayName[@]}"
do
   : 
   # do whatever on $i
done
$i will hold each item in an array. Here is a sample working script:
#!/bin/bash
# declare an array called array and define 3 vales
array=( one two three )
for i in "${array[@]}"
do
 echo $i
done