Sponsored Content
Full Discussion: sed command in c shell
Top Forums Shell Programming and Scripting sed command in c shell Post 31490 by Vishnu on Friday 8th of November 2002 10:04:57 AM
Old 11-08-2002
try this..

sed -e "s/^\(.*\)$/\1\'/g" yourfile > newfile

Cheers!
Vishnu.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

problem with sed command in shell script.

Guys, I've a problem in the "sed" command used in my shellscripts This is the problamatic line in my shell script: sed -e 's/${line1}/${line1_m}/g' prod_hier_1234.txt > test.txt It doesn't do the job of replacing the string stored in variable 'line1' to 'line1_m'. However If I replace the... (10 Replies)
Discussion started by: bhagat.singh-j
10 Replies

2. UNIX for Dummies Questions & Answers

SED command is not executing within the shell

Hallo everybody I am having a shell script called auto_run.sh in that only the first line works. the second line which has sed command is working only at the # prompt. not within the shell script. Your help is highly appreciated.Thank you in advance. exec auto_inv.4ge >KTI sed 's/ //g'... (1 Reply)
Discussion started by: naushad
1 Replies

3. Shell Programming and Scripting

Sed command in shell script

I have a current code working(named subst1) having a user be able to type this line to substitute words using the sed command: subst1 old-pattern new-pattern filename Here is my shell script: #!/bin/bash # subst1 ARGS=3 E_BADARGS=65 if then echo "Usage: `basename $0`... (1 Reply)
Discussion started by: Todd88
1 Replies

4. Shell Programming and Scripting

Quick Question on sed command in shell script

Hello, I have the following line in one of my shell scripts. It works fine when the search string($SERACH_STR) exists in the logfile($ALERTLOG) but if the search string does not exist this line errors out at run time. Is there a way to make this line return 0 if it is not able to find the... (4 Replies)
Discussion started by: luft
4 Replies

5. Shell Programming and Scripting

Need help using sed command in shell script?

Hello, i want to take the input from user and according to that variable's value search in file emp.lst. Here is what i came up with echo -e "Enter string to be searched :\c" read str sed -n '/\$str/p' emp.lst this is not working! any idea why?Thanks in advance! :) (4 Replies)
Discussion started by: salman4u
4 Replies

6. Shell Programming and Scripting

shell script/sed command help

First off I have read the man pages for sed and am still having trouble working on a script to remove portions of a log: My goal is to take a log file to be emailed, read the file and strip the portions away AFTER the line MIME-Version:1.0 and strip away until it to the line starting with... (4 Replies)
Discussion started by: murphybr
4 Replies

7. Shell Programming and Scripting

Using SED command in a shell script: Unterminated address regex

Hi All, I am trying to use a sed command in a shell script in order to delete some lines in a file and I got the following error message. I don't understand why it is not working 'cause I have tried with simple quotes, then with double-quotes, and it is not working. sed: -e expression #1,... (7 Replies)
Discussion started by: Alpha3363
7 Replies

8. Shell Programming and Scripting

sed command using variables in shell script

hi guys, The following command doesn't seem to work in my shell script: tag=$(sed -n '/${line}/ s/.*\.*/\1/p' myfile.txt) When i replace the ${line} with an actual value, it works fine. So, how do i use the ${line} in this sed command? Thanks in advance, Zaff (2 Replies)
Discussion started by: zaff
2 Replies

9. Shell Programming and Scripting

sed command not accepting variable in shell script

I am using a shell script in fedora linux. While calling to the shell I am also passing an argument (var1=0.77) like shown below sh gossip.sh var1=0.77 in the shell following command is written (which doesn't work) sed - i -e 's@prob=@prob="$var1";//@g' file.txt Actually i want the... (7 Replies)
Discussion started by: Fakhar Hassan
7 Replies

10. Shell Programming and Scripting

How to use a shell variable on sed command?

Hie everyone i have a complex sed command line which work fine for a static value given example sed -n '/SQL ID\:\ 1111111111111/!b;:a;/\*\*\*\*\*\*\*\*\*\*\*\*/!{$!{N;ba}};{/*/p}' ./MyInputFile.txt what i want is something like that sed -n '/SQL ID\:\... (2 Replies)
Discussion started by: ade05fr@yahoo.f
2 Replies
CP(1)							      General Commands Manual							     CP(1)

NAME
cp, cpdir - file copy SYNOPSIS
cp [-pifsmrRvx] file1 file2 cp [-pifsrRvx] file ... directory cpdir [-ifvx] file1 file2 OPTIONS
-p Preserve full mode, uid, gid and times -i Ask before removing existing file -f Forced remove existing file -s Make similar, copy some attributes -m Merge trees, disable the into-a-directory trick -r Copy directory trees with link structure, etc. intact -R Copy directory trees and treat special files as ordinary -v Display what cp is doing -x Do not cross device boundaries EXAMPLES
cp oldfile newfile # Copy oldfile to newfile cp -R dir1 dir2 # Copy a directory tree DESCRIPTION
Cp copies one file to another, or copies one or more files to a directory. Special files are normally opened and read, unless -r is used. -r also copies the link structure, something -R doesn't care about. The -s option differs from -p that it only copies the times if the target file already exists. A normal copy only copies the mode of the file, with the file creation mask applied. Set-uid bits are cleared if the owner cannot be set. (The -s flag does not patronize you by clearing bits. Alas -s and -r are nonstandard.) Cpdir is a convenient synonym for cp -psmr to make a precise copy of a directory tree. SEE ALSO
cat(1), mkdir(1), rmdir(1), ln(1), rm(1). CP(1)
All times are GMT -4. The time now is 10:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy