Skip to main content

Posts

Showing posts from July, 2019

Cron job tutorial series

Sometimes, instead of running a program manually we need it to be automated. This helps when we need some program to execute on regular intervals or schedule it for a particular time. Hence to handle such situations, linux gives us a tool called cron. what is a cron? Cron syntax

Git tutorial series

Git tutorials for beginner. Git installation Git configuration Initialize repository Working with directory Committing Git stash Create a branch Navigate between branches Merge branches Delete branches Rename branches

Git stash - Save current directory changes into a state

Git stash Save the current working directory changes to a state. Git stash list List of stashes Git stash apply Apply the stash to current directory Git stash drop Drop last stash Git stash clear Clear all the stashes

Bootstrap contact form

Responsive contact form Download from opensnippets.com

My first shell script program

1. Display list of files from a folder and stored it an array. 2. Select a file based on index. #!/usr/bin/env bash list_files=() i=0 for n in ruby/* do   list_files[i]+=$n   i=`expr $i + 1` done #echo $list_files k=0 echo ${#list_files[@]} while [ $k -lt ${#list_files[@]} ] do  echo $k ":"  ${list_files[$k]}  k=`expr $k + 1` done read value file_name=${list_files[$value]} echo $file_name cmd="ruby $file_name" eval $cmd  list_files stored files inside ruby folder. Repeating all the files with index. Once we select an index the program will run.