bestelbus22@lemmy.world to Programmer Humor@programming.dev · 5 months agoFor that modern web feelinglemmy.worldimagemessage-square12fedilinkarrow-up12arrow-down10
arrow-up12arrow-down1imageFor that modern web feelinglemmy.worldbestelbus22@lemmy.world to Programmer Humor@programming.dev · 5 months agomessage-square12fedilink
minus-squarecally [he/they]@pawb.sociallinkfedilinkEnglisharrow-up1·5 months agoperhaps i too will post code on the internet here is a shell script i wrote for automating filenames for markdown files (blog posts): code #!/bin/sh set -e datecmd="date +%Y-%m-%d" if [ -z "$1" ]; then printf "Post title: " >&2 read -r title else title="$1" fi file="$($datecmd)_$title.md" if [ -f "$file" ]; then printf "Error: post '$file' already exists.\n" >&2 exit 1 fi ${EDITOR:-nano} "$file" im not sure why i made it since i could just look at what date it is and write it down manually in the file name, but i felt like doing that as a quick hack
perhaps i too will post code on the internet
here is a shell script i wrote for automating filenames for markdown files (blog posts):
code
#!/bin/sh set -e datecmd="date +%Y-%m-%d" if [ -z "$1" ]; then printf "Post title: " >&2 read -r title else title="$1" fi file="$($datecmd)_$title.md" if [ -f "$file" ]; then printf "Error: post '$file' already exists.\n" >&2 exit 1 fi ${EDITOR:-nano} "$file"im not sure why i made it since i could just look at what date it is and write it down manually in the file name, but i felt like doing that as a quick hack