Sometimes, if you want to want to pass the whole "sentence" whcih with blank from shell script to another script which need to deal with the passed value, you will find that, the words has been exploded.
#!/bin/csh php test $argv
it's called "testshell", test is another script, and if you run it under console like this
./testshell "abc 123" "patrick 124"
In test script , if you print or dup the passed value.Normally,It should get arg(1)= "adc 123" arg(2)="patrick 124" in "test" script.But unluckly, the value are as below. arg(1)=abc arg(2)=123 arg(3)=patrick arg(4)=124. So this is a very hardest thing. And how to reslove this? Please refer to below, you just refer to http://www.staff.tugraz.at/reinfried.o.peter/unix/cshell.html, then you wiil get the answer. The solution are like this
#!/bin/csh php test $argv:q
Now, everybody is happy, you can get the whole sentence if you quote it.
One of my friend want to use my shell to be SH, so this have to be updated as below
#!/bin/sh php test "$@"
then you can get the space string directly
More detail, please refer to below
http://pubs.opengroup.org/onlinepubs/009695399/utilities/sh.html#tag_04_128_13_04
http://www.grymoire.com/Unix/Sh.html
相关推荐
MATLAB各种遗传算法下载地址 美国MathWorks《Genetic Algorithm and Direct Search ...SGALAB 1003 Beta 5.0.0.8( Matrix Varaible Inputs ) 英国Sheffield《genetic arithmetic toolbox》(GATBX遗传算法工具箱):
open ( "./data/deaths_nd_by_house.shp" )# get values for varaible "death_dum"v = snow . GetIntegerCol ( "death_dum" )# create a distance weights with distance threshold = 20 (meters)d20 = pygeoda . ...
2. 十六进制字变量(WORD VARAIBLE):A 定义为字变量,初值为 40H。 3. 十进制字节变量(BYTE VARAIBLE):B 定义为字节变量,初值为 40。 4. 二进制字节变量:C 定义为字节变量,初值为二进制的 01101010B,即十...
每当您不知道类应该使用variable还是常量时,都可以使用Reference Varaible作为字段。 每当需要访问Variable的值但不想更改它时,都可以使用ReadOnly Variable作为字段。 默认情况下,有4个不同的变量用于int , ...
首先,PVF(可能代表Property Value Format或Platform Varaible Format)是一种特定的数据存储格式,常用于游戏开发或者某些特定软件中,用来存储道具、地图、装备等游戏资源的数据。这些数据通常是二进制格式,对于...
2. **Out varaible声明**:可以在赋值的同时声明out参数,使得代码更加简洁。 3. **模式匹配**:新增了`is`表达式和`switch`语句的模式匹配能力,增强了条件判断的灵活性。 4. **空条件运算符**:`?.`运算符允许安全...
例如:<% String varaible = "Hello World!"; %> Scriptlet可以包含任何在Java Language Specification中有效的代码片断。 隐藏注释: 隐藏注释是jsp语法中的一种语法元素,用于在jsp文件中注释代码。隐藏注释格式...
- 静态变量:Static varaible在多次调用同一过程时保留其值,如`numa = numa + 2`。 这些知识点涵盖了计算机等级考试二级VB的主要内容,包括数据结构、算法分析、软件设计原则、数据库管理以及VB编程的基础知识,...