Sponsored Content
Full Discussion: Help with scripting
Top Forums Shell Programming and Scripting Help with scripting Post 302194961 by Northerner on Wednesday 14th of May 2008 04:39:20 AM
Old 05-14-2008
The output from this awk command is
0508 0601 LVTS4687 58 1ltreb_shu1l110 shu1l110
0509 0108 LVTS4687 58 1ltreb_shu1l110 shu1l110
0509 0108 LVTS4687 58 1ltreb_shu1l110 shu1l110
0509 0108 LVTS4687 58 1ltreb_shu1l110 shu1l110
0508 2206 LVTS5035 98 1sy_unix_live_dmz_duplex_15_35 srublae03-mgt
0508 2206 LVTS5035 98 1sy_unix_live_dmz_duplex_15_35 srublae03-mgt
0508 2206 LVTS5035 98 1sy_unix_live_dmz_duplex_15_35 srublae03-mgt
0508 2206 LVTS5430 98 1
0508 2206 LVTS5430 98 1
0508 2206 LVTS5430 98 1
0508 2206 LVTS5431 98 1lmurb_shu1l282 shu1l282-sy
0508 2206 LVTS5431 98 1lmurb_shu1l282 shu1l282-sy
0508 2206 LVTS5431 98 1lmurb_shu1l282 shu1l282-sy
0506 0920 LVTS5750 41 3nw_unix_live_dmz_duplex_35_35 NRUCCAE09-MGT
0506 0920 LVTS5750 41 3nw_unix_live_dmz_duplex_35_35 NRUCCAE09-MGT
0506 0920 LVTS5750 41 3nw_unix_live_dmz_duplex_35_35 NRUCCAE09-MGT
0506 0920 LVTS5750 41 3nw_unix_live_dmz_duplex_35_35 NRUCCAE09-MGT
0506 0920 LVTS5750 41 3nw_unix_live_dmz_duplex_35_35 NRUCCAE09-MGT
0506 0920 LVTS5750 41 3nw_unix_live_dmz_duplex_35_35 NRUCCAE09-MGT

Which is almost there apart from there being no space between parm5 and 6 and also parm 4 is reduced to the last 2 digits. Apologies for my ignorance on this but I have never used "awk" before. The file should look like this

0508 0601 LVTS4687 58 1 ltreb_shu1l110 shu1l110
0509 0108 LVTS4687 58 1 ltreb_shu1l110 shu1l110
0509 0108 LVTS4687 58 1 ltreb_shu1l110 shu1l110
0509 0108 LVTS4687 58 1 ltreb_shu1l110 shu1l110
0508 2206 LVTS5035 98 1 sy_unix_live_dmz_duplex_15_35 srublae03-mgt
0508 2206 LVTS5035 98 1 sy_unix_live_dmz_duplex_15_35 srublae03-mgt
0508 2206 LVTS5035 98 1 sy_unix_live_dmz_duplex_15_35 srublae03-mgt
0508 2206 LVTS5430 98 1
0508 2206 LVTS5430 98 1
0508 2206 LVTS5430 98 1
0508 2206 LVTS5431 98 1 lmurb_shu1l282 shu1l282-sy
0508 2206 LVTS5431 98 1 lmurb_shu1l282 shu1l282-sy
0508 2206 LVTS5431 98 1 lmurb_shu1l282 shu1l282-sy
0506 0920 LVTS5750 141 3 nw_unix_live_dmz_duplex_35_35 NRUCCAE09-MGT
0506 0920 LVTS5750 141 3 nw_unix_live_dmz_duplex_35_35 NRUCCAE09-MGT
0506 0920 LVTS5750 141 3 nw_unix_live_dmz_duplex_35_35 NRUCCAE09-MGT
0506 0920 LVTS5750 141 3 nw_unix_live_dmz_duplex_35_35 NRUCCAE09-MGT
0506 0920 LVTS5750 141 3 nw_unix_live_dmz_duplex_35_35 NRUCCAE09-MGT
0506 0920 LVTS5750 141 3 nw_unix_live_dmz_duplex_35_35 NRUCCAE09-MGT

Is it possible to format the file so each parm starts in a specific column for example

Parm1 in Col1
Parm2 in Col6
Parm3 in Col12
Parm4 in Col22
Parm5 in Col27
Parm6 in Col30
Parm7 in Col65
 

10 More Discussions You Might Find Interesting

1. AIX

New to scripting

We have a scripting requirement, Background: On a particular path, we compress a load of log files into tar.gz. This is done on an hourly basis throughout the day and it produces files of the following format, 2005-08-05-00-021031.tar.gz as an example. This is done by a script. We need: ... (2 Replies)
Discussion started by: rajesh_149
2 Replies

2. Shell Programming and Scripting

scripting guru's pls help me with scripting on AIX

can someone pls help me with the script for a files coming from one system to a particular directory and i want to write a script to move those files to another directory on different system by renaming the files... pls someone help me on this... thanking in anticipation.... (1 Reply)
Discussion started by: thatiprashant
1 Replies

3. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

4. UNIX for Advanced & Expert Users

Need help on scripting

in unix bc command is used as calculator and also for conversion, i want to convert 5f to decimal. but bc dont consider 5f as hex value it considers 5F as hex value. I get 5f from other iteration so i cant change that f to F...is there any way to convert 5f to decimal ot 5f to 5F :rolleyes: (2 Replies)
Discussion started by: abhinandantn
2 Replies

5. UNIX for Dummies Questions & Answers

Scripting Help

Hello all. Like Ive stated before, I am new to world of Unix. I was given the tast to create a script that will concatenate 20 files into one file. I know that the cat command is to be used but I am looking for something to get started on. Again, basically I need to wrtie a script that whill... (3 Replies)
Discussion started by: ndoggy020
3 Replies

6. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

7. What is on Your Mind?

Shell scripting vs Perl scripting

Hi all, I would like to start developping some good scripting skills. Do you think it would be best to start with shell scripting or Perl? I already got a fundation, really basics, in perl. but I am wondering what would be best to be good at first. Can you please help me determine which one to... (14 Replies)
Discussion started by: Pouchie1
14 Replies

8. Android

Android Scripting Environment: Shell Scripting and Android

I just upgraded to Android 2.2 from 2.1. The GPS issue that was troublesome in 2.1 seems to have been fixed. Some of web browsing seems faster, but it could just be my connection is better today ;) Flash works in some browsers but not very good and it is too slow for Flash apps designed for... (0 Replies)
Discussion started by: Neo
0 Replies

9. What is on Your Mind?

Shell Scripting vs Perl scripting

Gents, I have been working in a Solaris/Unix environment for about 9 months. I took some linux classses online before getting the job. But, I am not very good at scripting. I want to learn how to script. Do you think that I should start with Shell scripting or Perl? I wanted to continue with... (2 Replies)
Discussion started by: Pouchie1
2 Replies

10. Web Development

Perl scripting or shell scripting?

i am going to study any one of the scripting languages mentioned above(shell 0r perl scripting) . Which is having more scope for a fresher? (1 Reply)
Discussion started by: Anna Hussie
1 Replies
powerman-devices(7)                                                  powerman                                                  powerman-devices(7)

NAME
powerman-devices - Powerman Device Configuration Notes DESCRIPTION
Following are notes on configuring various remote power controllers and related equipment supported by PowerMan. CYCLADES TS-1000 A cyclades TS-1000 configured so that PowerMan can connect to serial-port-based remote power control devices using telnet is set up as fol- lows: Attach console cable between laptop running minicom and console port at 9600,8n1 and authenticate with default account: root/tslinux. Edit the following files (assumes no off-subnet routing or name service required): /etc/portslave/portslave.conf conf.eth_ip 192.168.54.151 conf.eth_mask 255.255.255.0 conf.dhcp_client 0 # all.speed 9600 all.datasize 8 all.stopbits 1 all.parity none all.flow none all.dcd 0 all.DTR_reset 1 all.protocol socket_server all.authtype none #all.ipno all.socket_port 7001+ # s1.tty ttyS1 s2.tty ttyS2 s3.tty ttyS3 s4.tty ttyS4 s5.tty ttyS5 s6.tty ttyS6 s7.tty ttyS7 s8.tty ttyS8 s9.tty ttyS9 s10.tty ttyS10 s11.tty ttyS11 s12.tty ttyS12 s13.tty ttyS13 s14.tty ttyS14 s15.tty ttyS15 s16.tty ttyS16 /etc/hostname cyclades-ts-test /etc/hosts 127.0.0.1 localhost 192.168.54.151 cycaldes-ts-test Next, run signal_ras hup and saveconf and finally, power cycle the unit. It should be possible to configure PowerMan to connect to host- name:7001 for port 1, hostname:7002 for port 2, etc.. BAYTECH RPC-3 (non-NC models) (network port 23) Attach console cable between laptop running minicom and console port at 9600,8n1. Main menu should display. From main menu, select 3)...Configuration, then set IP parameters. From Configuration menu, select 5)...Access, then disable command confirmation, set admin password to baytech, and enable prompt for pass- word. Exit Access menu by typing return. From Configuration menu, select 6)...Outlets. Ensure that 1)...Outlet Status display is disabled, and 2)...Command Confirmation is dis- abled. Exit back to main menu by typing return twice, then answer Y to the Accept changes? prompt. BAYTECH RPC-28-NC (serial 9600,8n1) Attach console cable between laptop running minicom and console port at 9600,8n1. Type return to get RPC-28> prompt. Type Help for a list of commands. Select config. Select 3)...Enable/Disable Confirmation and disable confirmation. Select 4)...Enable/Disable Status Menu and disable sta- tus menu LNXI ICEBOX V2 (network port 1010) Attach console cable between laptop running minicom and console port at 9600,8n1. Enter default password of icebox. net ip 192.168.54.153 Sets IP address. net mask 255.255.255.0 Sets network mask net gw 192.168.54.254 Set default gateway. Note: this may need to be set to an address in the same subnet as the ice box regardless of whether it is to be used or not. reboot Reboots the icebox. LNXI ICEBOX V3 (network port 1010) Attach console cable between laptop running minicom and console port at 9600,8n1. Authenticate with default account admin/icebox. Config- uration is the same as the V2 ICE BOX. APC MASTERSWITCH MODEL AP9606 (network port 23) Attach console cable between laptop running minicom and console port (may be labeled ``advanced port'') at 2400,8n1. Press enter, then authenticate with default account apc/apc. Choose Network from main menu. Choose TCP/IP from Network menu, then diable BOOTP, and accept changes. Set the IP address, subnet mask, and default gateway, and accept changes. Pres ESC until the main menu appears, then select Logout. WTI RPS10 (serial 9600,8n1) Set address of box using the rotary dial on the back. The Master module must be set to address 0. Slave modules may be set to unique val- ues from 1-9. The address corresponds to the plug name in the powerman.conf file. Setup switches on each module should be set to 9600 baud (sw1 down), 5 sec toggle delay (sw2 down), power up to previous state (sw3 down). WTI NPS (network port 23) Attach console cable between laptop running minicom and console port at 9600,8n1. Try password "wti" if prompted. Select /N - View/set network parameters, then set the IP address, subnet mask, and gateway. Select /G - General paramters, then disable command confirmation, enable command echo, and set disconnect timeout to the maximum value (30 minutes). Set password to "wti". CYCLADES PM8 and PM8i (serial 9600,8n1) Attach console cable between laptop running minicom and serial port 9600,8n1. Press enter, then authenticate with default account admin/pm8. Run factory_defaults command. The PM8 can run in a mode where it can be daisy chained from a Cyclades terminal server. This mode is not yet supported by PowerMan. Sun ILOM The dedicated ILOM serial port (SER MGT RJ-45) runs at 9600,8n1 and the default login is root/changeme. Use a Sun/NETRA/Cisco RJ45 adapter to connect to Cyclades TS. The dedicated ILOM ethernet port (NET MGT RJ-45) can be configured for DHCP (the default) or static IP settings. To configure static IP via the ILOM serial port, run: cd /SP/network set pendingipdiscovery=static set pendingipaddress=xxx.xxx.xxx.xxx set pendingipnetmask=xxx.xxx.xxx.xxx set pendingipgateway=xxx.xxx.xxx.xxx set commitpending=true The ILOM network configuration can alternatively be set up via the system BIOS setup screen. Hit F2 during boot to access BIOS setup, go to the "Advanced" tab, select "IPMI 2.0 configuration" and "set LAN configuration". Make your changes and commit them. IPMI (via Ipmipower) IPMI based power control is supported via FreeIPMI's ipmipower. It is configured by running ipmipower in coprocess mode in powerman.conf Due to semantic differences between IPMI and traditional remote power control devices, some power control operations may not seem to work properly by default with Powerman. For example, several IPMI power control operations are allowed to return prior to the operation fully completing. A machine that has been powered off by IPMI may be later queried as being powered on. This is because IPMI may successfully return from a power off operation to the user, but the machine may elect to power itself off at a later time. In order to get around sev- eral of these issues, it is recommended that the user configure ipmipower with the --wait-until-on and --wait-until-off options. With these options set, ipmipower will behave more like traditional remote power control devices. In order to hide IPMI usernames and passwords from ps(1), it is also recommended that the user configure the username and password (and at your discretion, the above options) using the FreeIPMI configuration file and not in the powerman.conf file. Please see the ipmipower sec- tion of the freeipmi.conf(5) manpage for more information. Because IPMI usernames and passwords are sensitive, the default FreeIPMI configuration file is only readable and writable by root. This may conflict with the default powermand daemon settings, thus making the configuration file non-readable. Administrators may wish to run the powermand daemon as root or adjust the configuration file permissions as needed. HP iLO The "hpilo" script supports the Integrated Lights-Out management processor in HP ProLiant servers, including both rack-mount and blade servers. Configure the iLO to allow Telnet access on port 23, and add a user "Admin" with password "Admin". You may have to reduce the minimum password length on the Administration/Access/Options tab of the web interface. HP MP
The "hpmp" script supports the Management Processor in HP non-cellular, rack-mount Integrity servers. Configure the MP to allow Telnet access with the "CM:SA" command, and make sure there's a user "Admin" with password "Admin". If the MP enforces a minimum password length, you may have to use "uc -all default" to restore the default Admin/Admin user. HP MP (cellular) The "hpmpcell" script supports the Management Processor in HP mid-range cellular servers. Configure the MP to allow Telnet access with the "CM:SA" command, and make sure there's a user "Admin" with password "Admin". HP MP (Superdome) The "hpmpdome" script supports the Management Processor in HP Superdome servers. Configure the MP to allow Telnet access with the "CM:SA" command, and make sure there's a user "Admin" with password "Admin". HP MP (Integrity blades) The "hpmpblade" script supports the Management Processor in HP Integrity blade servers. Configure the MP to allow Telnet access with the "CM:SA" command, and make sure there's a user "Admin" with password "Admin". ORIGIN
PowerMan was originally developed by Andrew Uselton on LLNL's Linux clusters. This software is open source and distributed under the terms of the GNU GPL. SEE ALSO
powerman(1), powermand(8), httppower(8), plmpower(8), vpcd(8), powerman.conf(5), powerman.dev(5), powerman-devices(7). http://sourceforge.net/projects/powerman powerman-2.3.5 2009-02-09 powerman-devices(7)
All times are GMT -4. The time now is 07:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy