10 More Discussions You Might Find Interesting
1. How to Post in the The UNIX and Linux Forums
usage: myscript.sh config.json
config.json:
{
"HOST":"abc",
"DB_NM":"xyz",
"USR_NM":"asd",
"PWD":"xxx",
.........
.........
.........
........
}
myscript.sh: (2 Replies)
Discussion started by: RGRT
2 Replies
2. Shell Programming and Scripting
Hello Team,
I am looking for help to read contains from { } and replace the word.
basically, I need to use this for nagios configuration file where each host/service define within {}.
I want script or syntax to which read first word/line from {} and replace the desire word within that {}.
... (5 Replies)
Discussion started by: ghpradeep
5 Replies
3. Programming
Hello All,
I have to write a C Code to read a word from file and Keep track of the number of word occurrence in each line and total in the file. Maintaining total count is easier but maintaining per line count is what I am struggling to achieve. I thought of maintaining linked list... (3 Replies)
Discussion started by: anand.shah
3 Replies
4. Shell Programming and Scripting
Hi All,
Hope you guys had a wonderful weekend
I have a scenario where in which I have to read a file line by line
and check for few words before redirecting to a file
I have searched the forum but,either those answers dint work (perhaps because of my wrong under standing of how IFS... (6 Replies)
Discussion started by: Kingcobra
6 Replies
5. Shell Programming and Scripting
Hi, I need a script to read last word of the line and out put in some temp file.
i
it can contain any word like:
My name is Harry.
or
My zip code is 24490
or it can be
My secret code is 024H
I just need last word of the line (Harry, or 2440 or 024H)
Thanks for the posts below.... (10 Replies)
Discussion started by: HarryReid
10 Replies
6. Shell Programming and Scripting
Hi,
I have a generic shell script (runBatchJob.sh) to read files (batchJob) with commands in them and execute the commands by reading the batchJob file as below
./runBatchJob.sh batchJob
batchJob file
$BATCHDIR/execute_procedure.sh
$DATADIR/collectData.sh
$OTHER_ENV_VAR/doSomething.sh
... (10 Replies)
Discussion started by: bOngY
10 Replies
7. Shell Programming and Scripting
Hi people;
i want to read the last word of the 14th line of my file1.txt. Here is the EXACT 14th line of the file.
250 SectorPortnum=3,AuxPortInUngo=2,PortDeviceGroup=1,PortDeviceSet=1,PorDevice=1 20 >>> Set.
i have to get the word Set. how can i call it and also how... (3 Replies)
Discussion started by: gc_sw
3 Replies
8. Shell Programming and Scripting
File having data in following format :
file name : file.txt
--------------------
111111;name1
222222;name2
333333;name3
I want to read this file so that I can split these into two paramaters i.e. 111111 & name1 into two different variables(say value1 & value2).
i.e val1=11111 &... (2 Replies)
Discussion started by: sjoshi98
2 Replies
9. UNIX for Dummies Questions & Answers
Hi
I am writing a script that needs to read all file from a directory and print only last word of all file names.
My script:
for file in /documents/files/
do
$shortFile=$(file##.*)
echo $shortFile
done
All my file names in /document/files/ directory are like unix_ubuntu but I need to... (1 Reply)
Discussion started by: watsup
1 Replies
10. Shell Programming and Scripting
Hi,
I want to read each word in a file.
start at a particular character say '%' and read till another character say ')' (these two characters form the part of my file).
then i want to delete the whole sentence(that is between '%' and ')' ) and keep the remaining file intact.
Its urgent... (1 Reply)
Discussion started by: kaps_jhaver
1 Replies