Sponsored Content
Full Discussion: changing format
Top Forums Shell Programming and Scripting changing format Post 302163053 by KevinADC on Thursday 31st of January 2008 12:51:06 AM
Old 01-31-2008
did you want to modify your current script to produce the desired output or write a new script to modify the output? Here is a perl solution until you clarify your requirements:

Code:
perl -pe 'BEGIN {$i = 0;} print $i++, " ", s/,/ /g;' inputfile > outputfile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing the date format

Hi, I know there is a Q/A section and lots of posts regarding date command here. I am sorry to start a new thread. I am very new to shell scripting (actually i am working on my first program), so please forgive my ignorance. I could not find an answer to my problem else where so i posted it... (10 Replies)
Discussion started by: Dream86
10 Replies

2. UNIX for Dummies Questions & Answers

Getting month and changing format

Hello, I would like to get todays moth and write it in this format: _06_ Any ideas? (7 Replies)
Discussion started by: marringi
7 Replies

3. Shell Programming and Scripting

changing month in Mmm format to mm FORMAT

i have an variable mydate=2008Nov07 i want o/p as in variable mymonth=11 (i.e nov comes on 11 number month) i want some command to do this for any month without using any loop. plz help me (1 Reply)
Discussion started by: RahulJoshi
1 Replies

4. Shell Programming and Scripting

Changing Date format

How to change a date stored in a variable to YYYYMMDD. Variable output is in DD-MON-YY,required format is 'YYYYMMDD' Thanks, Sud (1 Reply)
Discussion started by: sud
1 Replies

5. UNIX for Dummies Questions & Answers

Changing from Excel date format to MySQL date format

I have a list of dates in the following format: mm/dd/yyyy and want to change these to the MySQL standard format: yyyy-mm-dd. The dates in the original file may or may not be zero padded, so April is sometimes "04" and other times simply "4". This is what I use to change the format: sed -i '' -e... (2 Replies)
Discussion started by: figaro
2 Replies

6. Shell Programming and Scripting

changing the format of the list

I have a file such that List : a, b, c, d I want to list this as List a b c d however the trick is the number of arguments in the list is varies. There might be 0-7 variables . Can you help me? Please use code tags when posting data and code samples! (5 Replies)
Discussion started by: ozum
5 Replies

7. UNIX for Advanced & Expert Users

Changing the date format

Hi All, I am new to this forum, could any one help me out in resolving the below issue. Input of the flat file contains several lines of text for example find below: 5022090,2,4,7154,88,,,,,4/1/2011 0:00,Z,L,2 5022090,3,1,6648,88,,,,,4/1/2011 0:00,Z,,1 5022090,4,1,6648,88,,,,,4/1/2011... (0 Replies)
Discussion started by: av_sagar
0 Replies

8. Shell Programming and Scripting

Changing the date format

Hi all, I have a file with below data af23b|11-FEB-12|acc7 ad23b|12-JAN-12|acc4 as23b|15-DEC-11|acc5 z123b|18-FEB-12|acc1 I need the output as below:-(date in yyyymmdd format) af23b|20120211|acc7 ad23b|20120112|acc4 as23b|20111215|acc5 z123b|20120218|acc1 Please help me on this.... (7 Replies)
Discussion started by: gani_85
7 Replies

9. Shell Programming and Scripting

Changing Date Format

How can i make the date command output yesterday's date, current date and the date 4 days ago, in the following format: 2012-10-03 code: date +% ???? (3 Replies)
Discussion started by: SkySmart
3 Replies

10. Shell Programming and Scripting

Changing filename format

i need and outline to write a script that takes and old format and convert to a new format example: tupac - changes.mp3 and converts all mp3 files to the format of tupac/changes.mp3 thanks for taking your time (1 Reply)
Discussion started by: domdom110
1 Replies
sttydefs(1M)						  System Administration Commands					      sttydefs(1M)

NAME
sttydefs - maintain line settings and hunt sequences for TTY ports SYNOPSIS
/usr/sbin/sttydefs -a ttylabel [-b] [-f final-flags] [-i initial-flags] [-n nextlabel] /usr/sbin/sttydefs -l [ttylabel] /usr/sbin/sttydefs -r ttylabel DESCRIPTION
sttydefs is an administrative command that maintains the line settings and hunt sequences for the system's TTY ports by making entries in, and deleting entries from the /etc/ttydefs file. sttydefs with a -a or -r option may be invoked only by the super-user. sttydefs with -l may be invoked by any user on the system. OPTIONS
The following options are supported: -a ttylabel Add a record to the ttydefs file, using ttylabel as its label. The following describes the effect of the -b, -n, -i, or -f options when used in conjunction with the -a option: -b Enable autobaud. Autobaud allows the system to set the line speed of a given TTY port to the line speed of the device connected to the port without the user's intervention. -f final-flags Specify the value to be used in the final-flags field in /etc/ttydefs. final-flags must be in a format recognized by the stty command. final-flags are the termio(7I) settings used by ttymon after receiving a successful connection request and immediately before invoking the service on the port. If this option is not specified, sttydefs will set final-flags equal to the termio(7I) flags 9600 and sane. -i initial-flags Specify the value to be used in the initial-flags field in /etc/ttydefs. initial-flags must be in a format recog- nized by the stty command. These flags are used by ttymon when searching for the correct baud rate. They are set prior to writing the prompt. If this option is not specified, sttydefs will set initial-flags equal to the termio(7I) flag 9600. -n nextlabel Specify the value to be used in the nextlabel field in /etc/ttydefs. If this option is not specified, sttydefs will set nextlabel equal to ttylabel. -l[ttylabel] If a ttylabel is specified, sttydefs displays the record from /etc/ttydefs whose TTY label matches the specified ttylabel. If no ttylabel is specified, sttydefs displays the entire contents of /etc/ttydefs. sttydefs verifies that each entry it displays is correct and that the entry's nextlabel field references an existing -r ttylabel Remove any record in the ttydefs file that has ttylabel as its label. OUTPUT
If successful, sttydefs will exit with a status of 0. sttydefs -l will generate the requested information and send it to standard output. EXAMPLES
Example 1: A sample of sttydefs command. The following command lists all the entries in the ttydefs file and prints an error message for each invalid entry that is detected. example# sttydefs -l The following shows a command that requests information for a single label and its output: example# sttydefs -l 9600 ------------------------------------------------------------------ 9600:9600 hupcl erase ^h:9600 sane ixany tab3 hupcl erase ^h::4800 ------------------------------------------------------------------ ttylabel: 9600 initial flags: 9600 hupcl erase ^h final flags: 9600 sane ixany tab3 hupcl erase ^h autobaud: no nextlabel: 4800 The following sequence of commands will add the labels 1200, 2400, 4800, and 9600 and put them in a circular list: sttydefs -a 1200 -n 2400 -i 1200 -f "1200 sane" sttydefs -a 2400 -n 4800 -i 2400 -f "2400 sane" sttydefs -a 4800 -n 9600 -i 4800 -f "4800 sane" sttydefs -a 9600 -n 1200 -i 9600 -f "9600 sane" FILES
/etc/ttydefs ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), termio(7I) SunOS 5.10 14 Sep 1992 sttydefs(1M)
All times are GMT -4. The time now is 11:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy