I have a requirement to read job status from log files and each job has its own log file- read description...
up vote
1
down vote
favorite
I need to write a shell script to read job status from log files and each job has its own log file so need to read log file of every job and mail it to a DL.
linux
put on hold as too broad by Rui F Ribeiro, Thomas, RalfFriedl, schily, Fabby Nov 23 at 20:22
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
1
down vote
favorite
I need to write a shell script to read job status from log files and each job has its own log file so need to read log file of every job and mail it to a DL.
linux
put on hold as too broad by Rui F Ribeiro, Thomas, RalfFriedl, schily, Fabby Nov 23 at 20:22
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Have you tried anything yet? Or are we expected to tell you how to fulfill your requirement?
– John
Jun 27 '17 at 17:09
yes need an approach to read multiple files i am a beginner
– user2381383
Jun 27 '17 at 17:45
for $File in *; dowould be the start of a for loop. That for loop goes through every file in the current directory. You could dofor $File in *; do; cat $File; doneto print the content of every file in the current directory
– ADDB
Jun 27 '17 at 18:19
#! /bin/bash ls | grep autosys > jobs.txt while read LINE do cat "$LINE" | grep "Autosys" done <jobs.txt
– user2381383
Jun 28 '17 at 12:03
the above is working fien but can someone suggest the usage of for loop i mean wher e can it be effective i tried the above code on two files present in the directory it ran fine
– user2381383
Jun 28 '17 at 12:04
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I need to write a shell script to read job status from log files and each job has its own log file so need to read log file of every job and mail it to a DL.
linux
I need to write a shell script to read job status from log files and each job has its own log file so need to read log file of every job and mail it to a DL.
linux
linux
edited Nov 23 at 14:16
Rui F Ribeiro
38.2k1475125
38.2k1475125
asked Jun 27 '17 at 17:07
user2381383
61
61
put on hold as too broad by Rui F Ribeiro, Thomas, RalfFriedl, schily, Fabby Nov 23 at 20:22
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as too broad by Rui F Ribeiro, Thomas, RalfFriedl, schily, Fabby Nov 23 at 20:22
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Have you tried anything yet? Or are we expected to tell you how to fulfill your requirement?
– John
Jun 27 '17 at 17:09
yes need an approach to read multiple files i am a beginner
– user2381383
Jun 27 '17 at 17:45
for $File in *; dowould be the start of a for loop. That for loop goes through every file in the current directory. You could dofor $File in *; do; cat $File; doneto print the content of every file in the current directory
– ADDB
Jun 27 '17 at 18:19
#! /bin/bash ls | grep autosys > jobs.txt while read LINE do cat "$LINE" | grep "Autosys" done <jobs.txt
– user2381383
Jun 28 '17 at 12:03
the above is working fien but can someone suggest the usage of for loop i mean wher e can it be effective i tried the above code on two files present in the directory it ran fine
– user2381383
Jun 28 '17 at 12:04
add a comment |
Have you tried anything yet? Or are we expected to tell you how to fulfill your requirement?
– John
Jun 27 '17 at 17:09
yes need an approach to read multiple files i am a beginner
– user2381383
Jun 27 '17 at 17:45
for $File in *; dowould be the start of a for loop. That for loop goes through every file in the current directory. You could dofor $File in *; do; cat $File; doneto print the content of every file in the current directory
– ADDB
Jun 27 '17 at 18:19
#! /bin/bash ls | grep autosys > jobs.txt while read LINE do cat "$LINE" | grep "Autosys" done <jobs.txt
– user2381383
Jun 28 '17 at 12:03
the above is working fien but can someone suggest the usage of for loop i mean wher e can it be effective i tried the above code on two files present in the directory it ran fine
– user2381383
Jun 28 '17 at 12:04
Have you tried anything yet? Or are we expected to tell you how to fulfill your requirement?
– John
Jun 27 '17 at 17:09
Have you tried anything yet? Or are we expected to tell you how to fulfill your requirement?
– John
Jun 27 '17 at 17:09
yes need an approach to read multiple files i am a beginner
– user2381383
Jun 27 '17 at 17:45
yes need an approach to read multiple files i am a beginner
– user2381383
Jun 27 '17 at 17:45
for $File in *; do would be the start of a for loop. That for loop goes through every file in the current directory. You could do for $File in *; do; cat $File; done to print the content of every file in the current directory– ADDB
Jun 27 '17 at 18:19
for $File in *; do would be the start of a for loop. That for loop goes through every file in the current directory. You could do for $File in *; do; cat $File; done to print the content of every file in the current directory– ADDB
Jun 27 '17 at 18:19
#! /bin/bash ls | grep autosys > jobs.txt while read LINE do cat "$LINE" | grep "Autosys" done <jobs.txt
– user2381383
Jun 28 '17 at 12:03
#! /bin/bash ls | grep autosys > jobs.txt while read LINE do cat "$LINE" | grep "Autosys" done <jobs.txt
– user2381383
Jun 28 '17 at 12:03
the above is working fien but can someone suggest the usage of for loop i mean wher e can it be effective i tried the above code on two files present in the directory it ran fine
– user2381383
Jun 28 '17 at 12:04
the above is working fien but can someone suggest the usage of for loop i mean wher e can it be effective i tried the above code on two files present in the directory it ran fine
– user2381383
Jun 28 '17 at 12:04
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Have you tried anything yet? Or are we expected to tell you how to fulfill your requirement?
– John
Jun 27 '17 at 17:09
yes need an approach to read multiple files i am a beginner
– user2381383
Jun 27 '17 at 17:45
for $File in *; dowould be the start of a for loop. That for loop goes through every file in the current directory. You could dofor $File in *; do; cat $File; doneto print the content of every file in the current directory– ADDB
Jun 27 '17 at 18:19
#! /bin/bash ls | grep autosys > jobs.txt while read LINE do cat "$LINE" | grep "Autosys" done <jobs.txt
– user2381383
Jun 28 '17 at 12:03
the above is working fien but can someone suggest the usage of for loop i mean wher e can it be effective i tried the above code on two files present in the directory it ran fine
– user2381383
Jun 28 '17 at 12:04