Language Selection

English French German Italian Portuguese Spanish

Variable Mangling in Bash with String Operators

Filed under
HowTos

Have you ever wanted to change the names of many files at once? Or, have you ever needed to use a default value for a variable that has no value? These and many other options are available to you when you use string operators in bash and other Bourne-derived shells.

String operators allow you to manipulate the contents of a variable without having to write your own shell functions to do so. They are provided through "curly brace" syntax. Any variable can be displayed as ${foo} without changing its meaning. This functionality often is used to protect a variable name from surrounding characters.

Full Story.

More in Tux Machines

Switch to Linux part 1 – preparation

Microsoft would make you think it’s the only alternative, however that ignores the shining beacon of Linux just beyond the horizon. Once thought to be the malformed operating system of only the most hardcore tech nerds, speaking in riddles and snake languages such as ‘Python’, the Linux landscape has changed to be more welcoming to everyone. Read more

Kids aren't the only ones learning to share

The Four Freedoms The freedom to run the program, for any purpose (freedom 0). The freedom to study how the program works and change it so it does your computing as you wish (freedom 1). The freedom to redistribute copies so you can help your neighbor (freedom 2). The freedom to distribute copies of your modified versions to others (freedom 3). Read more

Today in Techrights

today's leftovers