Sponsored Content
Top Forums Shell Programming and Scripting sed -i option giving error no such file or directory Post 302747005 by yahoo on Thursday 20th of December 2012 11:06:33 AM
Old 12-20-2012
#!/bin/sh
sed -i 's/yes/no/' yes.txt
Code:
sed -i 's/why/where/' yes.txt
sed -i 's/when/how/' yes.txt

---------- Post updated at 11:03 AM ---------- Previous update was at 11:03 AM ----------

Code:
 
#!/bin/sh
sed -i 's/yes/no/' yes.txt
sed -i 's/why/where/' yes.txt
sed -i 's/when/how/' yes.txt

---------- Post updated at 11:06 AM ---------- Previous update was at 11:03 AM ----------

I am trying from cygwin, bash Shell sh, windows 7
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sed option to delete two words within a file

Could someone please help me with the following. I'm trying to figure out how to delete two words within a specific file using sed. The two words are directory and named. I have tried the following: sed '//d' sedfile sed '//d' sedfile both of these options do not work..... ... (4 Replies)
Discussion started by: klannon
4 Replies

2. Solaris

giving write access to selective users to a certain directory in solaris 10

Hi all, how can i grant write access to a selective users only with write access to a certain filesystem/directory in solaris 10. Please help..i tried "fs setacl"...does not seem to work Please adv..thanks in advance... (4 Replies)
Discussion started by: cromohawk
4 Replies

3. Shell Programming and Scripting

Read/Search file being written to giving error due to timing issues

The following is a piece of code to rename LOG_FILE_NEW to LOG_FILE once you get a result (either RUNNING or SHUTDOWN) RESULT="" sleep 30 while ; do sleep 10 RESULT=`sed -n '/RUNNING/'p ${LOG_FILE_NEW}` if ; then RESULT=`sed -n '/SHUTTING_DOWN/'p ${LOG_FILE_NEW}` fi done mv... (3 Replies)
Discussion started by: sonorous
3 Replies

4. UNIX for Dummies Questions & Answers

sed -i option example

Can anyone give detailed and example for sed -i option. Where can we use this option?:) (3 Replies)
Discussion started by: gwgreen1
3 Replies

5. Shell Programming and Scripting

Sed in vi - \r and \n not giving desired results

I use many different machines at work, each with different versions of o/s's and installed applications. Sed in vi is particularly inconvenient in the sense that sometimes it will accept the "\r" as a carriage return, sometimes not. Same thing with "\n". For instance, if I have a list of hosts... (7 Replies)
Discussion started by: MaindotC
7 Replies

6. Shell Programming and Scripting

sed -n option

Hi i am facing problem with sed -n option could you please help me on this, i have a file test the contents of the file is width="75">10/0 4/12</td>^M><a href='courtorders/100412zr.pdf' target="_blank">Miscellaneous Order</a></td>^M width="75">10/01/12</td>^M><a href='courtorde... (8 Replies)
Discussion started by: ragilla
8 Replies

7. Shell Programming and Scripting

sed and awk giving error ./sample.sh: line 13: sed: command not found

Hi, I am running a script sample.sh in bash environment .In the script i am using sed and awk commands which when executed individually from terminal they are getting executed normally but when i give these sed and awk commands in the script it is giving the below errors :- ./sample.sh: line... (12 Replies)
Discussion started by: satishmallidi
12 Replies

8. UNIX for Dummies Questions & Answers

What option will use for deleting directory with all its contents?

Hi How to completely delete directory with all it contents I try to use rmdir -r but it give error Thanks ---------- Post updated at 03:10 AM ---------- Previous update was at 02:52 AM ---------- Hi all I got the solution for my thread i use mkdir with the option -p Thanks (1 Reply)
Discussion started by: Tauatioti
1 Replies

9. AIX

Opening a file in vi editor is giving out of memory error

Below is the error: Out of memory saving lines for undo - try using ed : Please help me how do I open this file. Best regards, Vishal (5 Replies)
Discussion started by: Vishal_dba
5 Replies

10. Shell Programming and Scripting

sed replace is giving me sore thumbs

I want to replace only the exact match of string inside the file with another value during the run time. So, I have a file filename.txt where contents are: version="1.0.7", url="https://google.com/_api/version=GBMaster" now in my script I have variable and tried to replace the... (3 Replies)
Discussion started by: manas_ranjan
3 Replies
cvslock(1)							   User Manuals 							cvslock(1)

NAME
cvslock - lock CVS repositories SYNOPSIS
cvslock [-q] [-p pid] [-d CVS root] [-R|-W] [-u|-s|-c Command] [-l] directory DESCRIPTION
cvslock is used to lock a tree starting at directory in your CVS repository during low-level manipulation or inspection. There are various modes of operation: You can use the -s or -c options to cause cvslock to spawn a sub-shell or a shell command from which you can safely access the source repository. You can also use cvslock to lock and unlock CVS repositories from shell scripts; in this case you'll want to use the -p option to specify the process ID which is written to the lock files' names. The default when given no options is to acquire a persistant read lock. OPTIONS
-q This option tells cvslock to shut up and not print any diagnostic messages to stdout. This is most useful when using the program in conjunction with, e.g., rsync(1). -p pid The CVS lock files generated by this utility have the current process ID in their name to distinguish them from lock files generated by other tools such as cvs itself or concurrent sessions of cvslock. Use this option to force cvslock to use a specific pid. This is in most useful from shell scripts. -d CVS root This optional argument tells cvslock where your CVS repository's root is. If no -d switch is given, cvslock will fall back to the CVSROOT environment variable. Note that cvslock only works on local repositories, so don't try to access pserver or rsh-accessible remote repositories this way. -R This switch tells cvslock to acquire a lock for safe reading of the repository. -W This switch tells cvslock to acquire a write lock on the repository. -s When invoked with this option, cvslock will invoke the user's login shell as determined by the SHELL environment variable after locking the repository. After the user has left that shell, cvslock will drop the locks. -c Command This option is similar to the -s option, with the difference that cvslock will execute the shell command given on the command line instead of giving the user an interactive shell. -u When given this option, cvslock will try to drop a previously created lock on the repository in question. Using this option together with the -s or -c options is an error. The use of -p is highly recommended in conjunction with this option! -l This option tells cvslock to lock only the directory specified. Normally it locks the entire directory hierarchy under the speci- fied directory. DIAGNOSTICS
cvslock spits out some diagnostics to the standard error stream. It's exit value is zero if and only if the locking operation requested by the user could be performed successfully. Note that no diagnostics about the exit value of commands executed through the -c switch are given. BUGS
The signal handling is not too well-tested and may be broken. If you try to create the same lock several times, you will get funny effects due to the error recovery cvslock tries to do. SEE ALSO
Version Management with CVS rsync(1), system(3), cvs(1) AUTHOR
cvslock was put together in a quick hacking session by Thomas Roessler <roessler@guug.de> and may be distributed under the terms of the GNU General Public License version 2. Unix October 1998 cvslock(1)
All times are GMT -4. The time now is 06:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy