bestelbus22@lemmy.world to Programmer Humor@programming.dev · 3 months agoFor that modern web feelinglemmy.worldimagemessage-square40linkfedilinkarrow-up1335arrow-down13
arrow-up1332arrow-down1imageFor that modern web feelinglemmy.worldbestelbus22@lemmy.world to Programmer Humor@programming.dev · 3 months agomessage-square40linkfedilink
minus-squarecally [he/they]@pawb.sociallinkfedilinkEnglisharrow-up5·3 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
minus-squareunalivejoy@lemmy.ziplinkfedilinkarrow-up8·3 months agoScripts aren’t just for complex tasks. They’re also for consistency.
minus-squarebestelbus22@lemmy.worldOPlinkfedilinkarrow-up1·3 months agoLove this kind of stuff. I have a whole reposity of fish functions that do stuff because I’m too lazy :)
minus-squaretimsjel@piefed.worldlinkfedilinkEnglisharrow-up0·3 months agoHere is my most recent script, not gonna lie, pretty proud of this bad boy. /s shjava per/med/xwpp01 A001 conv.txt echo ‘yo’ shjava per/med/xwpp01 A002 conv.txt echo ‘yo’ shjava per/med/xwpp01 A003 conv.txt echo ‘yo’ shjava per/med/xwpp01 A004 conv.txt echo ‘yo’ shjava per/med/xwpp01 A005 conv.txt echo ‘yo’ shjava per/med/xwpp01 A006 conv.txt echo ‘yo’ shjava per/med/xwpp01 A007 conv.txt echo ‘yo’ shjava per/med/xwpp01 A008 conv.txt echo ‘yo’
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
Scripts aren’t just for complex tasks. They’re also for consistency.
Love this kind of stuff. I have a whole reposity of fish functions that do stuff because I’m too lazy :)
Here is my most recent script, not gonna lie, pretty proud of this bad boy. /s
shjava per/med/xwpp01 A001 conv.txt
echo ‘yo’
shjava per/med/xwpp01 A002 conv.txt
echo ‘yo’
shjava per/med/xwpp01 A003 conv.txt
echo ‘yo’
shjava per/med/xwpp01 A004 conv.txt
echo ‘yo’
shjava per/med/xwpp01 A005 conv.txt
echo ‘yo’
shjava per/med/xwpp01 A006 conv.txt
echo ‘yo’
shjava per/med/xwpp01 A007 conv.txt
echo ‘yo’
shjava per/med/xwpp01 A008 conv.txt
echo ‘yo’