#!/bin/bash
# Reading Manthan Status
echo "Manthan cat started"
cat /var/www/symmetric-ds-3.1.6/bin/my_mon.txt | while read LINE
do
echo "Inside my loop"
echo "$LINE"
if [ "$LINE" == "false" ]; then
echo "startedif_my"
sudo lsof -n -i:8082 | grep LISTEN | awk '{ print $2 }' | uniq |sudo xargs kill -9;
sleep 30;
sudo sh /var/www/symmetric-ds-3.1.6/bin/
I am trying to read user and server details from file tempo.txt and then check the disk space usage of the file system on that unix account using another script server_disk_space.sh.But I am not able to figure out why while loop is only working for first line and for loop is working fine.Please help me understand this.
Using while loop
#!/usr/bin/ksh
while read line
do
r1=`echo $line | cut -d"
For class I need to write a Bash script that will take the output from ispell and when I try and request user input inside the while loop it just saves the next line of the file as the user input.
How could I go about requesting user input in the while loop?
#!/bin/bash
#Returns the misspelled words
#ispell -l < file
#define vars
ISPELL_OUTPUT_FILE="output.tmp";
INPUT_FILE=$1
ispell -l <
I have a script like this,
#!/bin/bash
echo "hello" > a.txt
while [ True ]; do
#do something here, very long and possiblely causing system reboot
done
It looks like I can only get a normal a.txt (with "hello" inside) if the execution is ended normally.
Hi
I have a file which I am reading line by line and processing it.
But the last line is not getting read in the file loop until I put an enter in the end.
Code:
#!/bin/ksh -p
v_org_id=${P1}
FILE=${P2}
NEW_FILE_NAME=$APPLPTMP/b1.txt
BAKIFS=$IFS
IFS=$'\n'
exec 0<"$FILE"
echo "File to be processed.....: ${FILE}"
while read -r line
do
v_initial=`echo "$line&qu
Hi,
I'm trying to read a line and the next line in a shell script by executing the following code:
Code:
for i in `seq 1 $numLines`; do
line=$(sed -n '{$i}p' outputFile)
echo $line
done
$numLines contanis the outputFile's number of lines.
It doesn't work and I cannot use a while loop because I need to reed $(i+1) line after $i line.
I'm trying to use while read loop to read each entire line from a file, but have strange behaviour; my shell is located in a directory also containing *.csv file (I don't if there's a relation between those files and the behaviour.)
Loop:
while read line
do
echo $line
done < $FILE
When I execute my script I have that kind of result:
$ligne1 ==> OK
file1.csv file2.csv file3.csv $lig
Hi,
I try to read a multiline text from a console and write it to a file using a bash script. I want to end reading from a console if a user types the [Enter] key twice. I tried this loop:
Code:
while read LINE; do
if [ !
Hi All,
I'm writing a script to read a file line by line and then perform awk function on it. I am getting an error . My file has one name in it "James".