On Tue, 20 Oct 2020 18:11:23 -0500 Ranjan Maitra <mai...@email.com> wrote:

> Thanks, everybody, I am almost there. I am wondering how do I get to list the 
> files without the first two depths? So, here is  a part of my code:
>
> MAILDIR=$HOME/Maildir
> MHDIR=$HOME/mail
> FOLDERSPre=$(find $MHDIR -type d -mindepth 1)
>
> So, then I get a list of directories: /home/username/mail/....
>
> How do I get the /home/username out of it so that I can append the rest to my 
> Maildir directory?
>
> I guess this is now likely a bash question, and well and truly OT. Luckily, 
> every part of this thread is.

Sorry to answer my own question, but I managed to do this by using sed.

I used:

for ff in $FOLDERSPre

f=$(echo "$ff" | sed -e 's/mail/Maildir/')

which is easier than what i was trying to do: remove the /home/username/mail 
out and replace with /home/username/Maildir.

Ranjan
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org

Reply via email to