Sponsored Content
Full Discussion: change in line
Special Forums UNIX Desktop Questions & Answers change in line Post 302561540 by Tytalus on Tuesday 4th of October 2011 11:33:42 AM
Old 10-04-2011
Code:
using sub changes 1st instance:

#  echo "hello,,world,,how, are,,you" | nawk '{sub(",,",",",$0);print}'
hello,world,,how, are,,you

using gsub changes all instances:

#  echo "hello,,world,,how, are,,you" | nawk '{gsub(",,",",",$0);print}'
hello,world,how, are,you

HTH
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

change only selected line

hi i dont know how to go abt this? as i m new to unix. i have file say as xct. in file there are so many commands. . now here i m accepting new cron settings from user. but these new settings will be applicable for particular command. like my file is as * * * * * read a <... (0 Replies)
Discussion started by: d_swapneel14
0 Replies

2. UNIX for Advanced & Expert Users

%device line change

Hello and thank you in advance for any assistance. Working with SCO 5.0.5 our SCSI tape device is no longer working. Before we replace the unit I want to verify it's not related to a change someone may have made via mkdev tape. For years the boot message would list the tape device as this:... (1 Reply)
Discussion started by: sighbrrguy
1 Replies

3. Shell Programming and Scripting

change first word in the every new line

Hello, i'm new with the scripting on unix and i need such script or maby something to that way: I need to change the the first word in every new line to a given word. Using just /bin/sh ( not using sed, awk, perl and ect). I would be very grateful. (9 Replies)
Discussion started by: wrwe
9 Replies

4. Shell Programming and Scripting

Script to change file contents line by line

Hi, I'm struggling to write a script to do the following, -will go through each line in the file -in a specific character positions, changes the value to a new value -These character positions are fixed througout the file ----------------------- e.g.: file1.sh will have the following 3... (4 Replies)
Discussion started by: vini99
4 Replies

5. Shell Programming and Scripting

change line and rows

hej i have a simple question: is it possible to change rows and lines in a simple textfile with awk or something else? I have: 1 2 3 4 5 6 9 8 7 6 5 4 an I will have: 19 28 37 46 55 64 (1 Reply)
Discussion started by: talia
1 Replies

6. Shell Programming and Scripting

change line

Hello, I want to change a line at file whit a script i want to change line 150 for example, write hello and remove text of this line EXAMPLE LINE 150: my mother change to: LiNE 150: HELLO (4 Replies)
Discussion started by: uri_crack
4 Replies

7. Shell Programming and Scripting

change to one line for if then if then

if ! grep -q "aa" $line;then if ! grep -q "bb" $line;then somthing fi fi (2 Replies)
Discussion started by: yanglei_fage
2 Replies

8. Shell Programming and Scripting

Change one line to multiple

I did help some at another forum to change one line to multiple lines. var1="abc001: text goes here yyy003: text goes here uuuu004: text goes here" Running this awk, gives correct result, but its not very nice. Any idea on how to simplify it? awk '{for (i=1;i<=NF;i++) printf $i~":"?"\n"$i" ":$i"... (7 Replies)
Discussion started by: Jotne
7 Replies

9. Shell Programming and Scripting

How to change the line separator?

Hi All, I have a file with 20 columns, and the data itself has "\n" new line in it. So we have changed the row delimiter to ^E. Now i am unable to use head, wc -l etc... Please let me know how to change the line separator temporarily to run these unix commands. Thanks. (1 Reply)
Discussion started by: baranisachin
1 Replies

10. Shell Programming and Scripting

Change line end

Hello all, what I would like to have sounds quite simple... I have a file where the records have a line ending like (CR, LF, CR/LF, LFLF, ...) - so I do not know. In result I would like to have a file with UNIX line endings -> LF Maybe I can do it with a sed - but I do not... (8 Replies)
Discussion started by: API
8 Replies
ucblinks(1B)					     SunOS/BSD Compatibility Package Commands					      ucblinks(1B)

NAME
ucblinks - adds /dev entries to give SunOS 4.x compatible names to SunOS 5.x devices SYNOPSIS
/usr/ucb/ucblinks [-e rulebase] [-r rootdir] DESCRIPTION
ucblinks creates symbolic links under the /dev directory for devices whose SunOS 5.x names differ from their SunOS 4.x names. Where possi- ble, these symbolic links point to the device's SunOS 5.x name rather than to the actual /devices entry. ucblinks does not remove unneeded compatibility links; these must be removed by hand. ucblinks should be called each time the system is reconfiguration-booted, after any new SunOS 5.x links that are needed have been created, since the reconfiguration may have resulted in more compatibility names being needed. In releases prior to SunOS 5.4, ucblinks used a nawk rule-base to construct the SunOS 4.x compatible names. ucblinks no longer uses nawk for the default operation, although nawk rule-bases can still be specifed with the -e option. The nawk rule-base equivalent to the SunOS 5.4 default operation can be found in /usr/ucblib/ucblinks.awk. OPTIONS
-e rulebase Specify rulebase as the file containing nawk(1) pattern-action statements. -r rootdir Specify rootdir as the directory under which dev and devices will be found, rather than the standard root directory /. FILES
/usr/ucblib/ucblinks.awk sample rule-base for compatibility links ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ SEE ALSO
devlinks(1M), disks(1M), ports(1M), tapes(1M), attributes(5) SunOS 5.10 13 Apr 1994 ucblinks(1B)
All times are GMT -4. The time now is 02:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy