Sponsored Content
Full Discussion: sed edit in place -i issues
Top Forums Shell Programming and Scripting sed edit in place -i issues Post 302368296 by Franklin52 on Wednesday 4th of November 2009 02:17:30 PM
Old 11-04-2009
It works fine for me with the given sample file.
Do you get the desired output on the screen if you don't redirect it to a file?

To disable the prompt before overwriting of the the mv command, use the -f option.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Simple SED edit

I have output like the following: B D 20070116095820001 N D S0000579.LOG S0000582.LOG B D 20070116095750001 N D S0000574.LOG S0000576.LOG B D 20070116095734001 N D S0000570.LOG S0000573.LOG B D 20070116095705001 N D S0000569.LOG S0000569.LOG B D ... (5 Replies)
Discussion started by: rdudejr
5 Replies

2. Shell Programming and Scripting

Edit a large file in place

:confused:Folks, I have a file with 50 million records having 2 columns. I have to do the below: 1. Generate some random numbers of a fixed length. 2. Replace the second column of randomly chosen rows with the random numbers. I tried using a little bit of perl to generate random numbers... (6 Replies)
Discussion started by: mvijayv
6 Replies

3. Shell Programming and Scripting

ksh - truncate a log in place, sed -i not available captain!

Hi there:) Because of security requirements, It would be much better if I could truncate my logs in place using sed -i (or ?). I cant use the -i option on sed in my environment. Can anyone help a DBA? (5 Replies)
Discussion started by: quigley007
5 Replies

4. Shell Programming and Scripting

SED command help: Can we pass predefined variables in place of regex

Hi All, I have a doubt. Can we assign a regular expression for pattern searching to a variable in a script and then use that variable in place of a regular expression in sed command.I tried but got some syntax error!!Is it not possible.Because my requirement is that i have a generic script to get... (8 Replies)
Discussion started by: usha rao
8 Replies

5. Shell Programming and Scripting

SED: Place char at starting and replace selected line

Hello Experts, I am working on a small file editing script. Since all experts here are very generous to give me the complete code, I would take up the problem in steps so that I ensure my opportunity to learn. AIM: The script has some commented and some uncommented lines. I need to : ... (2 Replies)
Discussion started by: hkansal
2 Replies

6. Shell Programming and Scripting

How to get awk to edit in place and join all lines in text file

Hi, I lack the utter fundamentals on how to craft an awk script. I have hundreds of text files that were mangled by .doc format so all the lines are broken up so I need to join all of the lines of text into a single line. Normally I use vim command "ggVGJ" to join all lines but with so many... (3 Replies)
Discussion started by: n00ti
3 Replies

7. Shell Programming and Scripting

Place digit in front of the line searching pattern using sed command

hi All, i want to add the single digit front of the line in the report file and string compare with pattern file. patter file: pattern1.txt pattern num like 4 love 3 john 2 report file: report.txt i like very much but john is good boy i will love u so after execute... (9 Replies)
Discussion started by: krbala1985
9 Replies

8. Shell Programming and Scripting

edit sed command

how can i make this sed command run faster? sed '51000000,51347442!d' file and sed '51347442,$ !d' file File is a 9GB in size. it runs on sunos 5.10 and linux red hat 6 servers and i use bash. (5 Replies)
Discussion started by: SkySmart
5 Replies

9. Shell Programming and Scripting

awk pattern matching in place of sed

I have written a script to parse data from some files on a Solaris 10 system and send the output to a CSV formatted file. The code snipped i am using to pull the data is as follows.... src_line=$(sed -n "/^search_pattern$/{=;}" $file) for i in $src_line do start_line1=$(( i + 9 )) nawk -v... (4 Replies)
Discussion started by: electricheadx
4 Replies

10. UNIX for Beginners Questions & Answers

File manipulation place 0 before the number using sed

I'm new with sed, and i am really confused with slashes, backslashes, parentheses, I've tried reading some beginner's guide, but still trouble fixing this problem, do you have any tips where or what to read to learn more about sed? can you also help me with my problem? Note: I was tasked to use... (4 Replies)
Discussion started by: akopocpoypoy
4 Replies
VLOCK(1)							Linux User's Manual							  VLOCK(1)

NAME
vlock - Virtual Console lock program SYNOPSIS
vlock [ -hv ] vlock [ -acns ] [ -t <timeout> ] [ plugins... ] DESCRIPTION
vlock is a program to lock one or more sessions on the Linux console. This is especially useful for Linux machines which have multiple users with access to the console. One user may lock his or her session(s) while still allowing other users to use the system on other vir- tual consoles. If desired, the entire console may be locked and virtual console switching disabled. By default, only the current VC (virtual console) is locked. With the -a,--all option all VCs are locked. The locked VCs cannot be unlocked without the invoker's password or the root password. The root password will always be able to unlock any or all sessions, unless disabled at compile time. Please note that it is entirely possible to completely lock yourself out of the console with the -a,--all option if you cannot remember your password! Unless you are able to kill vlock by logging in remotely via a serial terminal or network, a hard reset is the only method of ``unlocking'' the display. When locking the entire console display it is sometimes still possible to kill vlock using the Secure Access Key (SAK) or other commands that are available through the SysRq mechanism. When the -s,--disable-sysrq and -a,--all options are given the SysRq mechanism is disabled while vlock is running. See /usr/src/linux/Documentation/sysrq.txt for more details. vlock works for console sessions primarily. To lock the entire console display from an X session use the -n,--new option. This will make vlock switch to an empty virtual console to lock the display. The options -n,--new, -s,--disable-sysrq, and -t,--timeout only work if vlock is compiled with plugin support. See the PLUGINS section for more information. OPTIONS
-a,--all Lock all console sessions and disable VC switching. -c,--current Lock the current session (this is the default). -n,--new Switch to a new virtual console before locking all console sessions. -s,--disable-sysrq Disable the SysRq mechanism while consoles are locked. This option only works if the -a,--all option given. -t,--timeout <seconds> Specify the timeout for the screensaver plugins. See vlock-plugins(5) for more information. -h,--help Print a brief help message. -v,--version Print the version number. ENVIRONMENT VARIABLES
The following environment variables can be used to change vlock's behavior: USER If this variable is when vlock is run as root (uid 0) vlock locks the screen as this user instead of root. The root password will still be able to unlock the session, unless disabled at compile time. VLOCK_ALL_MESSAGE If this variable is set and all consoles are locked its contents will be used as the locking message instead of the default message. VLOCK_CURRENT_MESSAGE If this variable is set and only the current consoles is locked its contents will be used as the locking message instead of the default message. VLOCK_MESSAGE If this variable is set its contents will be used as the locking message instead of the default. This overrides the former two variables. VLOCK_PLUGINS If this variable is set it is interpreted as a space separated list of plugins that will be loaded when vlock starts additionally to the ones listed on the command line. VLOCK_TIMEOUT Set this variable to specify the timeout (in seconds) after which the screen saver plugins (if any) will be invoked. If this vari- able is unset or set to an invalid value or 0 no timeout is used. See vlock-plugins(5) for more information about plugins. VLOCK_PROMPT_TIMEOUT Set this variable to specify the amount of time (in seconds) you will have to enter your password at the password prompt. If this variable is unset or set to an invalid value or 0 no timeout is used. Warning: If this value is too low, you may not be able to unlock your session. FILES
~/.vlockrc This file is read by vlock on startup if it exists. All the variables mentioned above can be set here. SECURITY
See the SECURITY file in the vlock distribution for more information. SEE ALSO
vlock-main(8), vlock-plugins(5) AUTHORS
Michael K. Johnson <http://danlj.org/mkj/> Frank Benkstein <frank-vlock@benkstein.net> Linux 28 July 2007 VLOCK(1)
All times are GMT -4. The time now is 11:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy