Sponsored Content
Full Discussion: Generate command with awk
Top Forums Shell Programming and Scripting Generate command with awk Post 302429714 by khalidou13 on Tuesday 15th of June 2010 09:04:32 AM
Old 06-15-2010
Lightbulb Generate command with awk

Hello,
I have the line underneath generated by lssyscfg command:

Code:
"""51/client/1/pcyaz0hjfv00-vio1/651/c050760107fd0466,c050760107fd0467/1"",""52/client/2/pcyaz0hjfv01-vio2/652/c050760107fd0468,c050760107fd0469/1"",""31/client/1/pcyaz0hjfv00-vio1/375/c050760107fd046a,c050760107fd046b/1"""

With a awk, i would like to generate Three command:

Code:
First command -->chsyscfg -r prof -m SDIN_E06-9119-FHA-5182D94 -i name=pcyaz0hrfv70_zsi,lpar_name=pcyaz0hrfv70-E1NA-B-MICADO_DATA-2,\"virtual_fc_adapters=\"\"51/client/1/pcyaz0hjfv00-vio1/651/c050760107fd0468,c050760107fd0469/1\"\"\"


Second command --> chsyscfg -r prof -m SDIN_E06-9119-FHA-5182D94 -i name=pcyaz0hrfv70_zsi,lpar_name=pcyaz0hrfv70-E1NA-B-MICADO_DATA-2,\"virtual_fc_adapters+=\"\"52/client/2/pcyaz0hjfv01-vio2/652/c050760107fd0466,c050760107fd0467/1\"\"\"

last command --> chsyscfg -r prof -m SDIN_E06-9119-FHA-5182D94 -i name=pcyaz0hrfv70_zsi,lpar_name=pcyaz0hrfv70-E1NA-B-MICADO_DATA-2,\"virtual_fc_adapters+=\"\"31/client/1/pcyaz0hjfv00-vio1/375/c050760107fd046a,c050760107fd046b/1\"\"\"

I want to reverse the character red with blue et blue with red for the thirst an d second command with a "+" in "virtual_fc_adapters+="
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Requesting an AWK code to generate averaged rows in a column

Hello, I request your kind help in solving this problem... I have a file with two columns and "n" number of rows. For the first column, it won't be change. For the second column, I want to take the average of the first three rows. Then assign the averaged value to the first three rows. This... (8 Replies)
Discussion started by: solracq
8 Replies

2. Shell Programming and Scripting

AWK: generate new line number

Hi. I have a script wich reads 1 file and generates 4. If the original file has 10 lines the the sum of the 4 generated files must have the 10 original lines. So far this works. Now what I need is to numerate the lines wtithin each generated file. I tried with NR but it prints the line... (2 Replies)
Discussion started by: mrodrig
2 Replies

3. UNIX for Dummies Questions & Answers

generate CSV file using AWK script

Hi guys I have a text report that consists of text in some parts and data in some parts. e.g Report for changes in cashflows No changes were found Report for changes in Bills deal_num deal_date trader maturity log_creator DF_234 20-5-2008 tman 20-5-2009 tman... (2 Replies)
Discussion started by: magikminox
2 Replies

4. Shell Programming and Scripting

help....generate command script

Please help..... if i have a file list below : 1233743158.log 1233743410.log 1233744186.log 1233744462.log "1233743158" is a unix time format it's require to a script "convertime.sh" to convert unix time format to readable time format like 20090204183010 -- YYYYMMDDHHMMSS ... (10 Replies)
Discussion started by: bleach8578
10 Replies

5. Shell Programming and Scripting

awk command in script gives error while same awk command at prompt runs fine: Why?

Hello all, Here is what my bash script does: sums number columns, saves the tot in new column, outputs if tot >= threshold val: > cat getnon0file.sh #!/bin/bash this="getnon0file.sh" USAGE=$this" InFile="xyz.38" Min="0.05" # awk '{sum=0; for(n=2; n<=NF; n++){sum+=$n};... (4 Replies)
Discussion started by: catalys
4 Replies

6. UNIX for Dummies Questions & Answers

Read the file and generate specific fields by awk

Hi I need to generate these output file from the below input file. Output : customer_id as customer, zip as zip_cd, catg_cd as catg, Input: out.customer::in.customer_id; out.zip_cd::in.zip; out.catg::in.catg_cd; Could you please help me on this. Please use code tags next... (1 Reply)
Discussion started by: Murugesh
1 Replies

7. Shell Programming and Scripting

To get older than last 7days records using awk scripting to generate report and send email

Hello All, I have need as below: 1--> I need to get all users(who submit jobs) and their details by using below command: qstat -u \* output of the above command looks line below: job-ID prior name user-id state "submit/start at" queue jclass slots ja-task-ID... (5 Replies)
Discussion started by: VasuKukkapalli
5 Replies

8. Shell Programming and Scripting

Generate sorted awk array for further processing

Hello to all, I have and input file like this: Objects (id: bounding-box centroid area mean-color): 0: 800x800+0+0 406.6,390.9 378792 srgb(0,0,0) 11: 240x151+140+624 259.5,699.0 36240 srgb(255,255,255) 6: 240x151+462+176 581.5,251.0 36240 srgb(255,255,255) 7: 240x151+87+257... (2 Replies)
Discussion started by: Ophiuchus
2 Replies

9. UNIX for Beginners Questions & Answers

awk use to generate report

Hi , In a directory list of ddl files are stored in the given format above. Above is the sample ddl file. The ddl file name is same as that of table name ie email_notifications.ddl I want to generate below report using awk utility reading all the ddl files stored in /ddl path Desired output:... (1 Reply)
Discussion started by: vedanta
1 Replies
set_color(1)							       fish							      set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 09:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy