Sponsored Content
Top Forums Shell Programming and Scripting Korn Shell script to insert at specific line Post 302626001 by Corona688 on Wednesday 18th of April 2012 04:26:24 PM
Old 04-18-2012
I never recommend editing in-place. One mistake and you'll trash all your originals.
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to parse a line and insert a word

Hi All, I have a file like this, data1,data2,,,data5,data6. i want to write a shell script to replace data3 with "/example/string". which means my data file should look like this . data1,data2,example/string],,data5,data6. Could you guys help me to get a sed command or any other command... (8 Replies)
Discussion started by: girish.raos
8 Replies

2. Shell Programming and Scripting

Korn shell program to parse CSV text file and insert values into Oracle database

Enclosed is comma separated text file. I need to write a korn shell program that will parse the text file and insert the values into Oracle database. I need to write the korn shell program on Red Hat Enterprise Linux server. Oracle database is 10g. (15 Replies)
Discussion started by: shellguy
15 Replies

3. Shell Programming and Scripting

Korn shell to insert cyrillic characters into the databse

i have written a shell script that reads a csv file and inserts tokenized strings into the database. the problem comes when the csv file has cyrillic characters. how do i set the parameters in my shell script(korn shell) so that any characters can be inserted into the database. (3 Replies)
Discussion started by: vkca
3 Replies

4. Shell Programming and Scripting

Print pipe separated list as line by line in Korn Shell

Korn Shell in AIX 6.1 I want to print the below shown pipe (|) separated list line by line. line=es349889|nhb882309|ts00293|snh03524|bg578835|bg37900|rnh00297|py882201|sg175883 for i in line do echo "Hello $line " done I wanted to execute the above for loop. But i can't even set the... (3 Replies)
Discussion started by: polavan
3 Replies

5. Shell Programming and Scripting

How to read from specific line number in shell script?

I have a text file which is having 30000 lines in it. I have to create a xml file for each 10000 lines until all the lines in the text files are written. Also please help how can i get number of lines in the text file in a shell variable? (19 Replies)
Discussion started by: vel4ever
19 Replies

6. Shell Programming and Scripting

Insert specific line when found similar value

Hi All, I have file like this: file1: 3778 10474 24 3778 10475 24 3778 10476 25 3778 10495 26 3794 10001 33 3794 10002 33 3794 10004 33 3794 10007 34 3794 10008 34 3794 10011 34 3794 10012 34 3794 10013 34 3794 10017 34 3810 10282 27 (6 Replies)
Discussion started by: attila
6 Replies

7. UNIX for Dummies Questions & Answers

shell script : log to txt and insert new line everytime

Hi, I have this script, while do ps ax|grep 5060 > log.txt echo " " sleep 1 done } I want to actually put a new line everytime the loop is executed in log.txt , but I do not know how to "embed" the echo " " inside the log.txt. (so to say... (1 Reply)
Discussion started by: peuceul
1 Replies

8. Shell Programming and Scripting

Insert text line to specific location CSV

In Perl. ***edited question below*** Hey all, I am teaching myself some simple CSV file manipulation and have become a little stuck. Say I have the following layout in the CSV file: age,name,locationIs it possible to INSERT data into the CSV into the correct age order. For example, if I had... (1 Reply)
Discussion started by: whyte_rhyno
1 Replies

9. Solaris

Insert a file at specific line

Hi, Anyone can help me in Solaris command on how to insert a file at specific line. I want file1.sql content to be inserted on file2.sh after "recover database using backup controlfile until cancel". # file1.sql /archivelogs/927_822338133.arc /archivelogs/671_822338107.arc... (3 Replies)
Discussion started by: fspalero
3 Replies

10. UNIX for Beginners Questions & Answers

How to insert new line after a specific character in scripts?

Hi, I'm trying to add a new line after finding a specific String. That is my string: volumes: - ${DIR_WORK}/loadbalancer/html:/var/www/html and I want to change that file to: volumes: - ${DIR_WORK}/loadbalancer/html:/var/www/html extra_hosts: -... (4 Replies)
Discussion started by: siamak
4 Replies
passwd(5yp)															       passwd(5yp)

Name
       passwd - password file description with the Yellow Pages service implemented

Description
       The  file  stores  initial login information, including passwords for each user in the system.  Regardless of whether or not the system has
       the Yellow Pages service implemented, the file contains the following information:

       Name (login name, contains no uppercase)
       Encrypted password
       Numerical user ID
       Numerical group ID
       User's real name, office, extension, home phone.
       Initial working directory
       Program to use as Shell

       The name can contain an ampersand (&), meaning insert the login name.  This information is set by the command and used by the command.

       This is an ASCII file.  Each field within each user's entry is separated from the next by a colon.  Each user is separated from the next by
       a new line.  If the password field is null, no password is demanded; if the shell field is null, the system defaults to the shell.

       This  file resides in the directory.  Because of the encrypted passwords, it can and does have general read permission and can be used, for
       example, to map numerical user IDs to names.

       Appropriate precautions must be taken to lock the file against simultaneous changes if it is to be edited with a text editor.  The  command
       does the necessary locking.

       In  a Yellow Pages environment, the file can also have a line beginning with a plus (+), which means to incorporate entries from the Yellow
       Pages data base.  There are three styles of + entries: by itself, + means to insert the entire contents of the Yellow Pages  password  file
       at  that  point;  +name means to insert the entry (if any) for name from the Yellow Pages at that point; +@name means to insert the entries
       for all members of the network group name at that point.  If a + entry has a nonnull password, directory, gecos, or shell  field,  it  will
       override what is contained in the Yellow Pages.	The numerical user ID and group ID fields cannot be overridden.

Examples
       Here is a sample file:
       root:q.mJzTnu8icF.:0:10:Privileged Account:/:/bin/csh
       jcj:6k/7KCFRPNVXg:508:10:JC Javert:/usr2/jcj:/bin/csh
       +john:
       +@documentation:no-login:
       +:::Guest

       In  this  example,  there  are  specific entries for users root and jcj, in case the Yellow Pages are temporarily out of service.  Alterna-
       tively, a user may need specific login information on a given system that differs from the information contained in the	Yellow	Pages  map
       for that user.  The user, john, will have his password entry in the Yellow Pages incorporated without change.  Anyone in the netgroup docu-
       mentation will have their password field disabled, and anyone else will be able to log in with their usual password, shell, and home direc-
       tory, but with a gecos field of Guest.

Files
See Also
       chfn(1), finger(1), login(1), passwd(1), crypt(3), getpwent(3), group(5), adduser(8), vipw(8)

																       passwd(5yp)
All times are GMT -4. The time now is 08:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy