- 浏览: 205070 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (138)
- Linux - Adiministration (4)
- Linux - Shell (3)
- Linux - Programming (10)
- Linux - Miscellaneous (57)
- Theory - Data Structure & Algorithm (2)
- Theory - Fundamentals of Compiling (0)
- Theory - Operating System (0)
- Theory - Database (0)
- Theory - Miscellaneous (0)
- Oracle (16)
- J2SE&J2EE (32)
- 杂项 (8)
- UCM (1)
- English (1)
- 我的超级菜谱 (1)
- Case - J2EE Tutorial (0)
- Case - J2EE架构师之优秀枪手 (10)
- Apache项目学习 (0)
最新评论
-
yaolixing01:
他山界面开发框架 v22是一套基于Gecko v22 的开源收 ...
Firefox Plugin - Gecko SDK/npapi -
chenpeilei2003:
您是这篇博文的原创吗 , 我通篇看完了, 很受教。
学习的目 ...
如何系统地学习linux? -
inprice:
羊蝎子 -
inprice:
...
羊蝎子 -
RobertLeeJesus:
因为我有两台T61
我安装Solaris的全过程。
Points
1. If you want to share the variants in a shell to the the children of the current processes. There are 2 ways in ksh,
1) . setEnv.ksh
2) eval "setEnv.ksh"
2. You can define a variants in the 3 ways, they are similar
1) OUTPUT="test"
2) OUTPUT="test"
export OUTPUT
3) typeset OUTPUT="test"
The difference are,
1) Typeset can set the variant as read-only.
2) The exported variants can be inherited by child processes.
3. What is diference between $VARIANT_NAME and ${VARIANT_NAME}?
1) $VARIANT_NAME populates the VARIANT_NAME to characters as many as possible. For example, $Fest equels ${Fest}.
2) ${VARIANT_NAME} can use REG to populate the expression values. For
example, TEST="/opt/sfw/gcc" echo ${TEST%/*}, will print /opt/sfw
4. Today, I made a test for the variants in ksh. I summarize the deals about ksh variants here.
1). All of the variants defined both in global area and inside function share the same variant area. Please see #2, #3 and #4.
2). If you define a variant in global area, you can get it inside a function.
3). If you define a variant inside a function, you can get it in a global area.
4). If you define a variant inside a function, you can get it in another function.
5). It is not the same situation with export keywork or not. That
is to say, the exported variants can be inherited by child processes.
In the same process, with the export or not, it doesn't matter. But if
you want child process to share the variant, you must export them.
6). In global area, $0, $1... is the process parameters while inside function is function parameters.
Reference
http://topic.csdn.net/u/20080602/22/cce87943-b9b1-4117-a138-9ac0b102257f.html
Source
test1() {
echo "before test()"
echo "TEST0: ${TEST0}"
echo "TEST1: ${TEST1}"
echo "TEST2: ${TEST2}"
echo "TEST3: ${TEST3}"
TEST0=$1
TEST1=$2
TEST2=$3
TEST3=$4
echo "after assign parameter inside test()"
echo "TEST0: ${TEST0}"
echo "TEST1: ${TEST1}"
echo "TEST2: ${TEST2}"
echo "TEST3: ${TEST3}"
TEST0="bde"
TEST1="bde"
TEST2="bde"
TEST3="bde"
export TEST2
export TEST3
echo "after test()"
echo "TEST0: ${TEST0}"
echo "TEST1: ${TEST1}"
echo "TEST2: ${TEST2}"
echo "TEST3: ${TEST3}"
TEST4="hahaha"
TEST5="hihihi"
export TEST5
echo "TEST4: ${TEST4}"
echo "TEST5: ${TEST5}"
}
{
TEST0="abc"
TEST1="abc"
TEST2="abc"
TEST3="abc"
export TEST1
export TEST3
echo "before call method"
echo "TEST0: ${TEST0}"
echo "TEST1: ${TEST1}"
echo "TEST2: ${TEST2}"
echo "TEST3: ${TEST3}"
test1 $TEST0 $TEST1 $TEST2 $TEST3
echo "after call method"
echo "TEST0: ${TEST0}"
echo "TEST1: ${TEST1}"
echo "TEST2: ${TEST2}"
echo "TEST3: ${TEST3}"
echo "TEST4: ${TEST4}"
echo "TEST5: ${TEST5}"
}
before call method
TEST0: abc
TEST1: abc
TEST2: abc
TEST3: abc
before test()
TEST0: abc
TEST1: abc
TEST2: abc
TEST3: abc
after assign parameter inside test()
TEST0: abc
TEST1: abc
TEST2: abc
TEST3: abc
after test()
TEST0: bde
TEST1: bde
TEST2: bde
TEST3: bde
TEST4: hahaha
TEST5: hihihi
after call method
TEST0: bde
TEST1: bde
TEST2: bde
TEST3: bde
TEST4: hahaha
TEST5: hihihi
发表评论
-
Replace text in file
2009-06-09 21:53 873Windows @echo off if ... -
cpio
2009-06-08 15:31 1072Extract cpio -i </ ... -
Start to use svn
2009-04-14 15:18 827http://artis.imag.fr/~Xavier.De ... -
Linux 查看磁盘分区、文件系统、使用情况的命令和相关工具介绍
2009-03-11 00:46 1462原文 http://www.linuxsir.or ... -
Solaris Compiz Desktop Effect doesn't work.
2009-03-01 23:34 838When I enable the Solaris Deskt ... -
How to make a process run after the user logs out?
2009-01-04 18:05 884nohup nohup sort sales.dat ... -
进行有效编辑的七种习惯(vim)
2008-12-16 11:52 1077如果你的很多时间是用 ... -
Miscelaneous Tricks to use the Linux Command Line
2008-12-10 14:29 8621. The process name for Linux e ... -
How to map remote network drive
2008-12-09 15:29 8591. sudo apt-get install smbfs ... -
Install the SSH server - openssh-server
2008-12-09 15:24 1076sudo apt-get install openssh-se ... -
Ubuntu系统目录结构
2008-12-09 08:52 1100Ubuntu系统目录结构 ================== ... -
Ubuntu APT Proxy
2008-11-22 14:43 1110When I use ubuntu desktop in VM ... -
Ubuntu 8.10 + T61 nvidia 显卡驱动(特效)(compiz)不好用
2008-11-16 20:30 21121. System -> Administration ... -
multiple disks, multiple partitions, multiple OS
2008-10-31 22:39 14191. 基本知识 一块硬盘可以有1-3个主分区和1个扩展 ... -
Ubuntu 8.10 + T61中间小红钮不好用
2008-10-31 20:11 10781. Edit /etc/X11/xorg.conf, a ... -
Common compress command.
2008-10-31 11:51 976zip -r dest.zip source unzip -d ... -
How to see how much is a folder or a file?
2008-10-31 11:41 760du -sh -
How to decide what Linux is installed?
2008-10-31 11:34 740vi /proc/version -
Adding a startup script to be run at bootup
2008-10-30 21:30 1312Ubuntu 1. sudo vi /etc/init ... -
如何删除老版本的Ubuntu内核
2008-10-28 16:49 919sudo aptitude purge ~ilinux-im ...
相关推荐
Many variants of ICP have been proposed, affecting all phases of the algorithm from the selection and matching of points to the minimization strategy. We enumerate and classify many of these variants...
Title: Cryptanalysis of RSA and Its Variants Author(s): M. Jason Hinek Series: Chapman & Hall CRC Cryptography and Network Security Series Publisher: Chapman and Hall/CRC City: Year: 2009 Edition: ...
Variants of Evolutionary Algorithms for Real-World Applications
在给定的压缩包“Matlab code for all variants of robust PCA and SPCP.zip”中,包含的是关于Matlab实现的多种鲁棒主成分分析(Robust Principal Component Analysis, RPCA)及其变种,以及稀疏主成分分析与低秩...
There are hundreds of Android hardware variants, which increases the risk of having errors in the software being deployed. Facebook has made significant progress in increasing the frequency of its ...
Describes and discusses the variants of kernel analysis methods for data types that have been intensely studied in recent years. This book covers kernel analysis topics ranging from the fundamental ...
这是一个Android Build Variants版本打包源码,涉及到创建keystore,配置keystore等等,下面是对应的链接 http://blog.csdn.net/qq_24349695/article/details/78540982 Android Studio中创建keystore ...
点云配准论文阅读笔记--Efficient Variants of the ICP Algorithm-附件资源
WAMP5 is a development environment for the Windows operating system ...From a special section of this tool official website is offered to download the different variants of the aforementioned utilities.
The codes are developed for the computation of the following causality measures: 1. transfer entropy (TE): TE.m2. partial transfer entropy (PTE): PTE.m3. eight (8) connectivity-based variants of PTE ...
- **Variants**: Specifies different variants of data types. - **Cryptographic Attributes**: Details attributes related to cryptography. - **Constants**: Lists constants used throughout the protocol. ...
and on the comparison with other NOMA variants. We highlight the main advantages of power-domain multiplexing NOMA compared to other existing NOMA techniques. We summarize the challenges of existing ...
Optimal Power flow(OPF) is allocating loads to plants for minimum cost while meeting the ... The variants of the problems are numerous which model the objective and the constraints in different ways
All problems are classified in terms of their difficulty level and include many variants to help you apply what you have learned more widely. All problems includes hints for readers who get stuck. ...
The PCI Express Base Specification is applicable to all variants of PCI Express. The PCI Express Card Electromechanical Specification focuses on information necessary to implementing an evolutionary ...
This iterative process allows each node to capture information from its neighborhood, enabling the model to learn representations that consider both local and global structures of the graph. ...
Characterization of HIV-1 Variants Resistant to an Electronically Constrained Peptide Fusion Inhibitor,Xiyuan Wu,,Emergence of drug resistant HIV-1 mutants is a serious problem for AIDS treatment....