I want to find the path of folder and store it into a variable
#!/bin/bash
howdy=$(whereis yum.repos.d)
howdy=$howdy"/remi.repo"
echo $howdy
The issue is that when I want to use the variable $howdy , it will output
yum.repos: /etc/yum.repos.d/remi.repo
I want it to be just the path
/etc/yum.repos.d/remi.repo
so I could use it in my code
you can use
awkto format the output:Full code:
this will output:
/etc/yum.repos.d/remi.repo