Let's say we run two programs in Linux shell. In one hit, like this:
who -r; date
What should I add to obtain one line output?
I would like to redirect output of command line in for loop as $line.
Output should be processed as line but instead it throw whole output.
Could somebody help me on how to redirect output of command line and process it line by line without sending output to any file.
Hello I have the following output from a simple debug jsp:
Weblogic Startup Since: Friday, October 19, 2012, 08:36:12 AM
Database Current Time: Wednesday, December 12, 2012, 11:43:44 AM
Weblogic JVM Current Time: Wednesday, December 12, 2012, 11:45:38 AM
Line 1 was a recorded variable during WebLogic webapp startup.
Line 2 was output from database query select sysdate from dual;
Line 3 was out
i have a log file that has the date and time that looks like this:
Code:
Wed Jun 28 15:46:21 2012 test failed tailed passed passed not error panic
what we want to focus on is the first 5 columns because they contain the date and time.
the date and time can be anywhere on the line. in this particular case, the date and time is at the beginning of the line.
I am trying to read the output of a command in bash using a while loop.
while read -r line
do
echo "$line"
done <<< $(find . -type f)
The output I got
ranveer@ranveer:~/tmp$ bash test.sh
./test.py ./test1.py ./out1 ./test.sh ./out ./out2 ./hello
ranveer@ranveer:~/tmp$
After this I tried
$(find .
Hi,I know this is not a bash place but I know there is some dev here so...I want to redirect sdtout and stderr to two different logs files with this way : exec 1>$LOG
exec 2>$ERROR_LOGIt works. But it's too basic, I want date and time at each lines.
Hi,
I have a file as below
This is the line one
This is the line two
<\XMLTAG>
This is the line three
This is the line four
<\XMLTAG>
Output of the SED command need to be as below.
This is the line one
This is the line two
<\XMLTAG>
Please do the need to needful to get the desired output.
I am very new to shell scripting, current try to do a sorting of a text file in paragraphs with ksh script.
example:
File content:
A1100001 line 1 = "testing"
line 2 = something,
line 3 = 100
D1200003 line 1 = "testing"
line 2 = something,
line 3 = 100
B1200003 line 1 = "testing"
line 2 = something,
line 3 = 100
i want the output to be like:
output:
A1
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 <