Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

shell - What is the internal processing of $* and $@ -


actually, understand use of $* , $@.

for example, if run script using: my_script *

then, one_file in $@ each file one_file processing.
there space(s) in filenames, one_file correct filename.

if, however, using one_file in $*, story different.
think guys understand difference , not need go further.

now, interested how.
how kornshell (ksh) interprets my_scrpt *
, pass filenames $@ correctly
, pass filenames $*.

for example, when ksh see my_script *
, put filenames 1 one array,
, put array[1][2][3]... $@ processing ?
and, when seeing $*, concat
filename1+space+filename2+space+... ?

i know may relate more internal coding of ksh.

any insight?

for example, when korn shell see my_script *, put filenames 1 one array, , put array[1][2][3]... $@ processing ? and, when seeing $*, concat filename1+space+filename2+space+... ?

yes, pretty much.

one important thing realize here there 2 separate processes involved: calling shell, expands my_script * myscript arg1 arg2 arg3 , subprocess gets array of arguments. if subprocess ksh (or sh, bash, or similar shell) $* syntax "get argv[1...] concatenated string" while $@ syntax "get argv[1...] array". it's important note $* , $@ meaningfully different when quoted.

in bash, cousin of ksh, idea of array variables has been generalized. (perhaps ksh has done -- haven't used ksh decade...)

in bash, creates array of 3 elements called a. note first element contains space:

[~]$ a=("foo bar" baz quux) [~]$ in ${a[*]}; echo $i; done foo bar baz quux [~]$ in ${a[@]}; echo $i; done foo bar baz quux [~]$ in "${a[*]}"; echo $i; done foo bar baz quux [~]$ in "${a[@]}"; echo $i; done foo bar baz quux 

as can see example, "${a[*]}" concatenates array while "${a[@]}" gives individual elements.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -