About 471,000 results
Open links in new tab
  1. String Manipulation in Shell Scripting - GeeksforGeeks

    May 24, 2021 · String Manipulation is defined as performing several operations on a string resulting change in its contents. In Shell Scripting, this can be done in two ways: pure bash string manipulation, and string manipulation via external commands.

  2. How to get a variable value if variable name is stored as string?

    How can I retrieve a bash variable value if I have the variable name as string? var1="this is the real value" a="var1" Do something to get value of var1 just using variable a.

  3. string - Extract substring in Bash - Stack Overflow

    Jan 9, 2009 · Given a filename in the form someletters_12345_moreleters.ext, I want to extract the 5 digits and put them into a variable. So to emphasize the point, I have a filename with x number of characters then a five digit sequence surrounded by a single underscore on either side then another set of x number of characters.

  4. Bash Scripting - String - GeeksforGeeks

    May 1, 2022 · Strings in bash can be easily concatenated by listing the strings in order. The length of a given string can be accessed using the # operator by placing it inside the parameter expansion (curly braces) before the variable name. Parts of an existing string can be replaced using / inside the parameter expansion. The syntax is given below.

  5. Creating a string variable name from the value of another string

    In my bash script I have two variables CONFIG_OPTION and CONFIG_VALUE which contain string VENDOR_NAME and Default_Vendor respectively. I need to create a variable with name $CONFIG_OPTION ie VENDOR_NAME and assign the value in CONFIG_VALUE to newly created variable. How I can do this? I tried. But I am getting an error on this line as. Thanks.

  6. String Operation in Bash Scripts: [Beginner's Guide]

    In this chapter, you will learn how to manipulate strings using a variety of string operations. You will learn how to get the length of a string, concatenate strings, extract substrings, replace substrings, and much more!

  7. Shell Scripting - Shell Variables - GeeksforGeeks

    May 16, 2024 · It could be an integer, filename, string, or some shell command itself. Basically, it is a pointer to the actual data stored in memory. We have a few rules that have to be followed while writing variables in the script (which will be discussed in the article).

  8. How to Manipulate Strings in Bash on Linux

    Jul 26, 2022 · Using them in a terminal window is a fast and convenient way to prototype your commands and perfect the syntax. It avoids the edit, save, run, and debug cycle. All we need to declare a variable and assign a string to it is to name the variable, use the equals sign. , and provide the string.

  9. How to Use String Variables in Bash Script? [4 Cases]

    Dec 24, 2023 · For example, if you have a variable named name, you can include it in a string like this: echo "Hello, ${name}!". The curly braces help to delimit the variable name from surrounding text and ensure accurate variable substitution within the string.

  10. String Manipulation in Bash | Baeldung on Linux

    Mar 18, 2024 · Bash is a sh-compatible shell and command processor and string manipulation is one of the most common tasks to be done in a shell environment. In this tutorial, we’ll learn how to operate on strings using Bash.

  11. Some results have been removed
Refresh