Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

read file and while loop example

#!/bin/sh
while read input_text
do
  case $input_text in
        hello)          echo English    ;;
        howdy)          echo American   ;;
        gday)           echo Australian ;;
        bonjour)        echo French     ;;
        "guten tag")    echo German     ;;
        *)              echo Unknown Language: $input_text
                ;;
   esac
done < myfile.txt
Comment

PREVIOUS NEXT
Code Example
Shell :: bash special format specifier 
Shell :: copy file from windows to linux permission denied wsl 
Shell :: find command create today 
Shell :: how to cd into a directory with a space linux 
Shell :: sqlmap enumerate table content 
Shell :: microstack connect to mysql server 
Shell :: how to simultaneously originate to both users in fs 
Shell :: how to install pakages using ancaonda prompt 
Shell :: one hyphen vs two hyphens command line 
Shell :: chorium cli 
Shell :: autoremove kali linux 
Shell :: how do confirm a commit revert git 
Shell :: manjaro set to never sleep 
Shell :: iterm full screen cmd 
Shell :: awk split on comma 
Shell :: how to reslove Jira Software is licensed but not currently installed 
Shell :: vim reload highlight 
Shell :: how to perform an action for each line in bash 
Shell :: windowscommand to delete direcoty with specified name recursivel 
Shell :: how to set chmod 777 to folder 
Shell :: bash how to find all pdf file in subdir and copy 
Shell :: pip install django tenant users 
Shell :: install yacc fedora 
Shell :: libopusfile.so.0 terminal download 
Shell :: cmd echo datetime in loop 
Shell :: ${env:windir} user profile list environment variables 
Shell :: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.ccc.notification signatures do not match previously installed version; ignoring!] 
Shell :: linux paginate output 
Shell :: Invariant Violation: requireNativeComponent: "RCTPdf" was not found in the UIManager. 
Shell :: open ssl change pkcs1 to pkcs8 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =