hey champs,
i have a files, whose contents are as follows,
abcdefghijk
lmnopqrstuv
..............
..............
i want to replace every other 3rd character to some specified character.
let here in this file i want to replace each 3rd character to z.
abzdezghzjk
lmzopzrszuv... (2 Replies)
I want to find the number of occurences of a character in a file.
How do i do it.
Eg:
$cat file1.txt
Welcome to World of Unix.
$
If i want to find the occurences of 'o' then I should be getting 3.
Thanks. (6 Replies)
Hi,
Is there any way to merge two lines based on specific occurance of a character in a file.
I am having a flat file which contains multiple records.
Each row in the file should contain specified number of delimiter.
For a particular row , if the delimiter count is not matched with... (2 Replies)
I want to know how to, given a string like W87151WR71C, if the 4th and 5th character (in this case 15) are greater than 45, then to add 1 to the 3rd character (in this case 7) and assign the revised string the variable name MODSTRING.
Thanks in advance. This is ultimately to grab info from... (6 Replies)
Hi all,
Greetings,
I have the following scenario, The contents of main file are like :
Unix|||||forum|||||||||||||||is||||||the||best
so||||||be|||||on||||||||||||||||||||||||||||||||||||||||||||it
And i need the output in the following form:
Unix=forum=is=the=best
so=be=on=it
... (3 Replies)
Hi,
I hope someone can share there scripting fu on my problem,
I would like to delete the 3rd character from a random length of string starting from the end
Example
Output
Hope you can help me..
Thanks in advance.. (3 Replies)
Hi all,
I am very new to unix - ksh. I want to replace some characters in a file with some other, but only for first three occurances for each line.
For eg:
the first 3 occurances character ']' has to be replaced with ',' in each line.
Please help.
thanks
Sreejith (1 Reply)
Hello to all,
I have the following text where columns are separated by spaces. I want to have the 3rd column separating
3 strings with 2 "_" in the format below:
LeftSring_CentralString_RightString
So, in 3rd column I want to replace all "_" with "-", except the first and last "_"
The... (5 Replies)
I have a file which comes every day and the file data look's as below.
Vi abc.txt
a|b|c|d\n
a|g|h|j\n
Some times we receive the file with only a new line character in the file like
vi abc.txt
\n (8 Replies)
Discussion started by: rak Kundra
8 Replies
LEARN ABOUT CENTOS
sgpio
sgpio(1) USER COMMANDS sgpio(1)NAME
sgpio - captive backplane LED control utility
SYNOPSIS
sgpio [-h] [-V] [[-d|--disk <device>[,<device>...]] | [-p|--port <port>[,<port>...]]] [-s|--status <status>] [-f|--freq <frequency>]
DESCRIPTION
Serial General Purpose Input Output (SGPIO) is a communication method used between a main board and a variety of internal and external hard
disk drive bay enclosures. This utility can be used to control LEDs in an enclosure. For more information about SGPIO, please consult the
SFF-8485 Specification.
OPTIONS -h, --help
displays a short help text
-V, --version
displays the utility and AHCI SGPIO specification
-d, --disk
disk name of LED location. Names are sda,sdb,sdc,... Multiple names can be provided in a comma-delimited list.
-p, --port
SATA port number of LED location, can be used if a disk name is no longer valid. 0,1,2,3,... Multiple ports can be provided in a
comma-delimited list.
-s, --status
status of the LED to set. LED status is: locate, fault, rebuild, off
-f, --freq
Set the frequency at which the LED should blink (in Hz). Frequency should be an integer between 1 and 10.
EXAMPLES
Set the locate LED on SDA with an Intel Intelligent backplane:
sgpio -d sda -s locate
Set the locate LED on SDA to flash at 3 Hz for non-intelligent backplanes:
sgpio -d sda -s locate -f 3
Set SATA port 2 with fault at a 3 Hz flash rate:
sgpio -p 2 -s fault -f 3
Set disks sda through sdf to fault:
sgpio -d sda,sdb,sdc,sdd,sde,sdf -s fault
EXIT STATUS
sgpio should return zero when successful. It will return with a non-zero value if there was a failure.
AUTHOR
Eric R. Hall <Eric.R.Hall@intel.com>
version 0.3 December 2007 sgpio(1)