Psed syntax -- specifically the write option


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Psed syntax -- specifically the write option
# 1  
Old 07-20-2011
Psed syntax -- specifically the write option

EDIT: Nevermind. I found a forth kludge to get around the psed requirement!


Short version: I'm trying to use the "w" flag with psed to write all substituted lines into another file. No matter how many times I read the man pages or search with Google, I can't seem to find the proper syntax for this command. Can anyone help?

This is the closest my guessing got me, in case this helps you understand what I'm attempting to do:
Code:
psed -a s/$/EOL/w test.txt test2.txt

Background: I have a kluge on top of a kludge on top of a kluge that requires me to use psed to take the contents of a file, append a single character onto the end of each line (though just copying each line would be enough), and spit out the output into another file. I cannot use the handy '>', I can't use sed, I can't pipe things into another command with |, or use any other standard *NIX shell device. psed and its arguments are the *only* tool available in this certain circumstance. My problem is that the psed man pages are about as clear as country gravy, and nothing is available online except the (useless) man pages. I've already played with this for about an hour, and I've concluded that I must be missing something obvious.

Last edited by CluelessPerson; 07-20-2011 at 04:33 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Syntax for screen with -h option

Hi Team, I am using Linux OS. I am using the screen command and I am able to see few lines in the screen. I want to see more line in my screen. I want to use the screen with -h option. Please let me know how to use this command. So that I can see more line in my screen session. ‘-h num' Set... (1 Reply)
Discussion started by: Mukharam Khan
1 Replies

2. Red Hat

How do I network a Suse installed machine with other computers, specifically Red hat Linux?

How do I network a Suse installed machine with other computers, specifically Red hat Linux? This is for a school project, and I can't find any pages that tell how to network a Suse to other computers except how to use a printer. (1 Reply)
Discussion started by: Anna Hussie
1 Replies

3. Shell Programming and Scripting

Renaming multiple files, specifically changing their case

Hey all, I'm running a BASH shell and I was wondering if anyone knows a code to rename all the files in a directory. All I need to do is change the first character in the file from uppercase to lowercase and some of the files are already lowercase so they don't need to change. -Thanks (4 Replies)
Discussion started by: jjzieve
4 Replies

4. Shell Programming and Scripting

Need script to format data specifically

Hi all, I need a script specially using loops to print below output... variables x, a and b will be read from user... x a b x+1 a b+1 x+2 a b+2 x+3 a+1 b x+4 a+1 b+1 x+5 a+1 b+2 for example.... 1 ... (4 Replies)
Discussion started by: swapniltathe
4 Replies

5. Shell Programming and Scripting

recently introduced to the newer option for find...does an older option exist?

To find all the files in your home directory that have been edited in some way since the last tar file, use this command: find . -newer backup.tar.gz Is anyone familiar with an older solution? looking to identify files older then 15mins across several directories. thanks, manny (2 Replies)
Discussion started by: mr_manny
2 Replies

6. IP Networking

write() / read() syntax

hi am newbie to unix and socket programing I am trying to figuring out syntax for read and write to send data from server to client and client can read it I have to send two integers write(newsockfd,buffer,"%d %d",x,y,0) writing from client where x and y are two integers.. ... (7 Replies)
Discussion started by: karthik1238
7 Replies

7. Shell Programming and Scripting

Specifically name an output file in bash

What is the best way to specifically name an output file in a bash script? My current script has the following output code. awk 'BEGIN {print "CASE GID vd d-theta GID vd d-theta"} {print $0}' > "$TOL"_try.txt The variable $TOL is an input to the script. I would... (4 Replies)
Discussion started by: cold_Que
4 Replies

8. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

9. Shell Programming and Scripting

How do I write multiple variable syntax?

I am trying to write a script that will do a sql statement. But in the sql I will have a list (1,2,3,4). How would I go about asking for the input from the user running the script, and then transferring that back into the list as say ($var1,$var2,$var3)? It would be somewhat like this: ... (1 Reply)
Discussion started by: Captain
1 Replies

10. Linux

postfix configuration issues...specifically masquerading (lack of )

postfix configuration issues...specifically masquerading (lack of ) Mail sent to our intranet arrives correctly (me@domain.com). Mail sent to our intranet arrives correctly (me@domain.com). Anything going outside does not, so my tests get rejected (me@hostname.com) :( any assistance... (5 Replies)
Discussion started by: mr_manny
5 Replies
Login or Register to Ask a Question