bash variable expansion: ${!1}, ${1#/} & usage of export and typeset without any argument -


I am trying to read through the bash script for rvm installation, but I have difficulty understanding the following lines .

Export do without any argument?

line 241: type _account _domain _pattern _repo _sources _values ​​_version

Question: What does typeet do without any argument?

  line 242: _sources = ($ {! 1})  

Question: How to interpret such variable detail I have already referred to the bush reference Is checked (), yet it does not get much.

  line 510: branch = $ {1 /} line 514: if [["$ {1% /}" -including a vignette]] & amp; Amp; [["$ {1% /}" -a MPPs]]  

Question: These two variable extensions can not understand, either.

Thanks for any help!

export lists all export variables and their definitions without any argument Note that there are many arguments in your line on export .

typeset was replaced by declare . Again, without logic, it lists everything that was declared, but your example argues in the command.

$ {! 1} is a variable indirection $ 1 retains the name of the variable whose value will be returned:

  test = x set - test echo $ { ! 1} # returns x   

$ {1 /}} $ 1 from the beginning of / Removes $ {1% /} from the end.

See man bash in parameter expansion for details.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -