Hi, I need you help.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Hi, I need you help.
# 1  
Old 03-14-2014
Hi, I need you help.

I am new to bash. But I need read a snippet of script. I saw some expression like this below. I can figure it out by coding a snippet.

But I fount that the curly bracket("{}") have so much use. Could you please give some tutorial about the curly bracket, or some sort of summary about it?

I will really appreciate it.
Thank you in advance.

1. ${1%%[0-9]*} It means to intercept $1 from the place digits begins, and assign the non-digits to $1. If $1 starts with num then just assign null to $1

2. ${{1//[^0-9a-zA-Z_]/_} This means to replace all elements if it is not digits, alphabets or underscore with underscore.
# 2  
Old 03-14-2014
Please use code tags as required by forum rules!

Not sure what you want to know. Your interpretations are correct. All ${...} are parameter expansions or array references, see there in man bash. Other use of {...} is concatenating a command list, and creating sequences in brace expansions. Again, man bash will help.
# 3  
Old 03-14-2014
Please use google before asking such easy questions here.
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question