Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

shell script loop while process running

#!/bin/bash
x=1
while [ $x -le 5 ]
do
  echo "Welcome $x times"
  x=$(( $x + 1 ))
done
Comment

shell script loop while process running

#!/bin/bash
counter=$1
factorial=1
while [ $counter -gt 0 ]
do
   factorial=$(( $factorial * $counter ))
   counter=$(( $counter - 1 ))
done
echo $factorial
Comment

shell script loop while process running

while [ condition ]; do commands; done
while control-command; do COMMANDS; done
Comment

shell script loop while process running

while [ condition ]
do
   command1
   command2
   command3
done
Comment

shell script loop while process running

#!/bin/bash
FILE=$1
# read $FILE using the file descriptors
exec 3<&0
exec 0<$FILE
while read line
do
	# use $line variable to process line
	echo $line
done
exec 0<&3
Comment

PREVIOUS NEXT
Code Example
Shell :: command line remove Unrecognized character xC3; 
Shell :: add-apt-repository command not found ubuntu 20.04 
Shell :: sbt debian 
Shell :: ufw script no prompt 
Shell :: Linux Tor enabled 
Shell :: apache virtual host file 
Shell :: bash search multiple string in on line 
Shell :: how to run two files together in repl.it 
Shell :: fslmaths multiplication masking 
Shell :: fslstats center-of-gravity 
Shell :: permission denied: unknown 
Shell :: docker compose deps 
Shell :: synology virtual machine install agent 
Shell :: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease 
Shell :: go remove specific library 
Shell :: fibre device linux 
Shell :: find command create today 
Shell :: arash addine 
Shell :: publish repositry 
Shell :: Installs pip3, git, git-lfs, curl, wget 
Shell :: centos 8 gui 3 
Shell :: linux df -h levels occupy 
Shell :: flasky fake 
Shell :: grep search for text in php files recursive 
Shell :: cost accounting gitman 
Shell :: check for webhint version 
Shell :: linux check how many open files are allowed 
Shell :: Openstack on ubuntu 18.04 
Shell :: bash get types of file extensions in directories 
Shell :: how to get a zombie villager in minecraft 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =