Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make file name equal to title property in md files #12

Open
MoatazAbdAlmageed opened this issue Mar 21, 2022 · 1 comment
Open

make file name equal to title property in md files #12

MoatazAbdAlmageed opened this issue Mar 21, 2022 · 1 comment

Comments

@MoatazAbdAlmageed
Copy link
Owner

to make edit links works in single post

@MoatazAbdAlmageed
Copy link
Owner Author

bash script


#!/bin/bash
prefix="title:"

for filename in *.md; do
        # name=cat $filename| grep -w title
        # echo $name

# foo="`cat $filename`"
# echo "${foo[@]}"
newFileName=`sed -n '2p' < $filename | sed  -e 's/ //g' -e "s/^$prefix//"` 
echo $filename
echo $newFileName
mv $filename  $newFileName
#  echo "$filename" | sed -e "s/^$prefix//"

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant