Bash Comparing similar strings
I am writing a bash script to rename complex files names to somehting simpler. Is there a way in bash to find part of a string that is similiar as opposed to exactly the same? For example: test1 and random_complex_file_test1.txt would match and the file could then be renamed test1.
|
This is where I'm at:
Code:
#! /bin/bash |
This kind of works will add extra features later. Here it is if anyone else wantes to try this:
Code:
#! /bin/bash |
If you wish to place a string after a variable name, simply enclose the variable in {}:
Code:
mv "$PWD/$file" "$PWD/${users}.pdf" |
All times are GMT -5. The time now is 02:35 PM. |