sed command performs string substitutions.
- It is usually used to add, remove or change parts of a string.
- This is often invaluable for modifying variables.
- Syntax for changing
$ v=`echo $v | sed s/im/Subject/g`
$ echo $v
Subject1.nii.gz Subject2.nii.gz Subject3.nii.gz
- Warning: The characters
. * [ ] / have special
meaning in the first string unless preceded by a backslash
- Tip: Any character can be used instead of
which can be very handy when dealing with directories/files