Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

read file using shell script

#!/bin/bash
input="/path/to/txt/file"
while IFS= read -r line
do
  echo "$line"
done < "$input"
Comment

read the file from shell

#!/bin/sh
value=`cat config.txt`
echo "$value"

#!/bin/bash
value=$(<config.txt)
echo "$value"
Comment

PREVIOUS NEXT
Code Example
Shell :: gitignore exclude folder 
Shell :: how to install swift on ubuntu 
Shell :: ffmpeg install ubuntu 
Shell :: bash command in variable 
Shell :: bash two for loops 
Shell :: git clone private repo 
Shell :: curl certificate and password 
Shell :: composer install on mac 
Shell :: bower uninstall 
Shell :: how to kill a service based on port number on mac 
Shell :: how to install mvnw 
Shell :: execute c# ubuntu 
Shell :: openni 2 ros package install 
Shell :: open /var/lib/docker/tmp/buildkit-mount140273675/Dockerfile.base: no such file or directory 
Shell :: install bc command linux 
Shell :: remove pdf last list 
Shell :: install maven ubuntu 20.04 
Shell :: git pull master for feature branch 
Shell :: react icons 
Shell :: waiting for your editor to close the file 
Shell :: tar archive all files in directory 
Shell :: sed between two matches 
Shell :: how to check gems installed 
Shell :: pm2 remove process from list 
Shell :: zsh shell 
Shell :: how to exit root user in linux 
Shell :: mac tftp server directory 
Shell :: run shell script linux 
Shell :: verbose stack Error: bcrypt@1.0.3 install: `node-pre-gyp install --fallback-to-build` 
Shell :: matlab activation client 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =