[bash] fucn | grep '^' - Linux

By Candice
at 2011-02-23T11:19
at 2011-02-23T11:19
Table of Contents
##inside shell:
function func()
{
# do someting
VARI=1
}
##
##input
func | grep '^'
echo $VARI
##
##output
##
why not display "1"?
--
劍客 - 賈島 ╭═ █ ☆ ███ ☆╰══════════════╮
十年磨一劍,霜刃未曾試。║ █ ☆ ███ ☆ ███ ☆ ▉██ ☆ ▉██ ☆║
今日把示君,誰有不平事?╬ █ ☆ ███ ☆ ███ ☆ ███ ☆ ███ ☆╫
╬ █ ☆ ██▉ ☆ ▇▇█ ☆ ███ ☆ ███ ☆╫
║ █ ☆ ██▉ ☆ ▉██ ☆ █▉█ ☆ █▉█ ☆║
╰╮ █ ☆ ███ ☆ █▉█ ☆ █▉█ ☆ █▉█ ☆╝
--
function func()
{
# do someting
VARI=1
}
##
##input
func | grep '^'
echo $VARI
##
##output
##
why not display "1"?
--
劍客 - 賈島 ╭═ █ ☆ ███ ☆╰══════════════╮
十年磨一劍,霜刃未曾試。║ █ ☆ ███ ☆ ███ ☆ ▉██ ☆ ▉██ ☆║
今日把示君,誰有不平事?╬ █ ☆ ███ ☆ ███ ☆ ███ ☆ ███ ☆╫
╬ █ ☆ ██▉ ☆ ▇▇█ ☆ ███ ☆ ███ ☆╫
║ █ ☆ ██▉ ☆ ▉██ ☆ █▉█ ☆ █▉█ ☆║
╰╮ █ ☆ ███ ☆ █▉█ ☆ █▉█ ☆ █▉█ ☆╝
--
Tags:
Linux
All Comments

By Jacob
at 2011-02-27T22:26
at 2011-02-27T22:26

By Isla
at 2011-03-02T11:45
at 2011-03-02T11:45

By Daph Bay
at 2011-03-03T16:20
at 2011-03-03T16:20

By Mary
at 2011-03-07T14:27
at 2011-03-07T14:27

By Edward Lewis
at 2011-03-09T19:01
at 2011-03-09T19:01

By Kristin
at 2011-03-12T15:17
at 2011-03-12T15:17

By Rachel
at 2011-03-15T19:54
at 2011-03-15T19:54

By Sierra Rose
at 2011-03-16T19:54
at 2011-03-16T19:54

By Daniel
at 2011-03-17T13:34
at 2011-03-17T13:34
Related Posts
dbn squeeze 系統慢慢的?

By Michael
at 2011-02-22T23:22
at 2011-02-22T23:22
Ubuntu裡面看不到光碟機..

By Genevieve
at 2011-02-22T22:50
at 2011-02-22T22:50
CentOS 4.7 64bit 自動執行tcsh的指令後改回bcsh

By Elvira
at 2011-02-22T20:35
at 2011-02-22T20:35
ubuntu建立捷徑

By Audriana
at 2011-02-22T19:05
at 2011-02-22T19:05
問一個shell script的寫法

By Valerie
at 2011-02-22T13:55
at 2011-02-22T13:55