Create HTML with Header and assign values


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Create HTML with Header and assign values
# 1  
Old 04-02-2019
Create HTML with Header and assign values

Hi All

Below is the output i have from my code

Code:
10.106.86.93 A1,A2,A2,A3,A3,A4,A5,A6,B1,B2,B3,B4,B5,B5,B6,B6,C1,C1,C2,C2,C3,C3,C4,C4,C5,C5,C6,D1,D2,D3,D4,D5,D6,D6 3

Need to create a html with header and for the last value (3) if it is 3 then it should print ok, if 4 then print NotOk

e.g.
Code:
Servername                       Index                                                                          Status 
10.106.86.93                         A1,A2,A2,A3,A3,A4,A5,A6,B1,B2,B3                       ok

The values in the above is separated by space.

Please let me know how to do this
# 2  
Old 04-02-2019
Welcome to the forum.


Any attempts / ideas / thoughts from your side?


Why does the index output stop at B3 and suppresses the remainder of the field, B4 ... D6?
Where is the HTML part that you requested in the title?
# 3  
Old 04-02-2019
Thanks..That was just an example i gave. so stopped at B3. the html part is the below e.g. mentioned.
i am new to bash and searching for help but not able to figure it out

Last edited by Snehasish; 04-02-2019 at 12:30 PM..
# 4  
Old 04-02-2019
Please become accustomed to provide decent context info of your problem.

It is always helpful to carefully and detailedly phrase a request, and to support it with system info like OS and shell, related environment (variables, directory structures, options), preferred tools, adequate (representative) sample input and desired output data and the logics connecting the two including your own attempts at a solution, and, if existent, system (error) messages verbatim, to avoid ambiguities and keep people from guessing.





Quote:
Originally Posted by Snehasish
... the html part is the below e.g. mentioned.
This statement definitely in not enough! Nothing is mentioned anywhere. What should your final HTML file look like?

Quote:
i am new to bash and searching for help but not able to figure it out
How did you produce the input data? What be your code that provides "the output i have from my code"?
This User Gave Thanks to RudiC For This Post:
# 5  
Old 04-02-2019
From the desired output you are looking for i suppose what you want to have is a HTML table. You may want to use this link to w3schools (english) or, if you happen to speak german, the phantastic SelfHTML to come up with a design you like. Simply try to manually create a HTML version of the example input you posted. Then post this HTML code and we can help you create a script to get the one from the other.

I hope this helps.

bakunin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Assign Unknown Values to Variables

i have a program that spits out a certain number of values. i dont know the number of values. they can be 4, 10, 7, 20, no idea. but, i want to be able to assign each of the value returned by this program to a variable. in the latest instance, the program gave the following 6 values: 4... (8 Replies)
Discussion started by: SkySmart
8 Replies

2. Shell Programming and Scripting

A better way to assign values to variables - shell

so i've been used to doing it this way: SVAL=$(echo "7 3 2 38 3" | awk '{print $2}') 4VAL=$(echo "4:21:N:3" | awk -F":" '{print $4}') I know there's a way to do it by putting the value in an array and assigning it that way. but i'm not sure how to do it efficiently. any ideas? i dont... (9 Replies)
Discussion started by: SkySmart
9 Replies

3. Shell Programming and Scripting

Read record from the text file contain multiple separated values & assign those values to variables

I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables. I need to read this file which is an input to my script Config.txt file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies

4. Shell Programming and Scripting

Sendmail with header and footer logo in HTML body

Hello, I need help with my script that will send email via sendmail command that will shows both the header and footer logo once the recepient receive the email (e.g. MS Outlook). When I tested to ran the script it will successfully send the email BUT UNFORTUNATELY it doesn't displayed the... (8 Replies)
Discussion started by: lawrence88
8 Replies

5. UNIX for Dummies Questions & Answers

How to assign values to variable in given scenario

Hi i have one variable like DIR="f1 f2" in config file in my script i have one runtime variable LFILE="DIR" now i want to use $DIR in my script by using LFILE that is i dont want to use DIR dirctly i am extracting DIR by some other means. Config file : DIR="f1 f2" Script: LFILE="DIR" i... (3 Replies)
Discussion started by: sriram_gec
3 Replies

6. Programming

Can't assign struct variable in header file

Hi guys. I have a header file including a structure like this: typedef struct { int index = -1; stack_node *head; } stack; But when compiling with cc it shows error at the assignment line (int index = -1): error: expected ‘:', ‘,', ‘;', ‘}' or ‘__attribute__' before ‘=' token... (1 Reply)
Discussion started by: majid.merkava
1 Replies

7. Shell Programming and Scripting

Assign values to variable

Hi Masters, I want to assign the values of one variable to another variable. Here the varaible name 'var' is dynamic. I know the values of V_2 and U_3, but If the i/p of TYPE is 'U' and the NO is 3, then I want to assign the values of U_3 to var. How we can achieve it? TYPE="U"... (4 Replies)
Discussion started by: ecearund
4 Replies

8. Shell Programming and Scripting

Assign values to variables of a file

Hi, I have a file like the following... CUST= DIR= NULIST= name=philps_123 How can i add values to each of these unassigned variables using a shell script? say for eg: i have values for CUST as onida, dir as /dir/onida, NULIST as /tmp/onida_files. How can i add these values to... (11 Replies)
Discussion started by: Tuxidow
11 Replies

9. Shell Programming and Scripting

assign values from awk output - help

Dear All, I have a command which gives the number of fields of each line of a comma-separated file. sthng like this : cat QDB_20071126_002.bad | awk -F"," '{ print NF }' I need to assign the first output and the last output of the above command to variables in a script. Need help to do... (4 Replies)
Discussion started by: KrishnaSaran
4 Replies

10. UNIX for Dummies Questions & Answers

to assign cut values to an array

i need to seperate values seperated by delimiters and assign it to an array.. can u plz help me on that. Variables = "asd,rgbh,(,rty,got,),sroe,9034," i need to assign the variables into arrays.. like.. var=asd var=rgbh.. and so on how do i do this. i need to reuse the values stored in... (6 Replies)
Discussion started by: Syms
6 Replies
Login or Register to Ask a Question