General :: Vi/vim And The "insert-only-one-char" Command?
Dec 2, 2010
a vim (alghough I esteem the corresponging vi command is the same) command to insert one character only, into the text being edited. That is, I'm in command mode, I issue command INSERT, I type a character, and automatically I'm again in command mode, where INSERT is the command I do not know. I have vimtutor but do not see it explained there.
View 7 Replies
ADVERTISEMENT
Feb 3, 2011
I am trying the execute the following
#!/usr/bin/python
import os
os.system("sed -e 's#^(.*) (.*)0http://12#' t2.txt > t3.txt")
os.system("cat t3.txt | sort | uniq -c | sort -rn | head > t4.txt")
But I receive the following error message.
sed: -e expression #1, char 27: unterminated `s' command
View 1 Replies
View Related
Dec 4, 2010
Just in case someone can reply a silly question, I've quite forgot the vi/vim command to bring the cursor to the 1st char in the current line. I do remember that for bringing it to EOL is '$'.
View 14 Replies
View Related
Jan 4, 2010
I would like to insert a line into the /etc/sysconfig/iptables with a command like sed or with any script. How can I insert this line:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
but under the line "-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT"
View 2 Replies
View Related
Oct 4, 2010
I want to insert the text "DB dept" in the last line of passwd file which looks like this right now
Quote:
newuser:x:717:717::/home/sacharje:/bin/bash
And I want it to be like this:
Quote:
newuser:x:717:717: DB dept:/home/sacharje:/bin/bash
I tried to do that with sed but failed, I'd like to know the proper syntex with sed to achieve this.
View 7 Replies
View Related
Jan 28, 2010
I need to be able to edit a file from the commend line as I intend to script this operation, the file is called menu.lst The original is as below
Code:
titleUbuntu 8.04.3 LTS, kernel 2.6.24-24-generic
root(hd0,0)
kernel/boot/vmlinuz-2.6.24-24-generic root=UUID=b09feb23-5524-4ec4-862f-94700b968f64 ro quiet splash
[code]....
View 4 Replies
View Related
Mar 4, 2010
m getting the following error when trying to compile:Quote:
$ make
g++ -march=athlon64 -O2 -pipe -fomit-frame-pointer -msse3 -c -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"undelete"' -DHAVE_SVDRP -I../../../include undelete.c
[code]...
View 14 Replies
View Related
Nov 4, 2010
Programming in C.I have two char arrays.char buf1[1024];char buf2[1024];Aren't buf1 and buf2 also pointers?I read in 1024 bytes into buf1 which contain about 300 bytes of characters with newlines. The data is basically a few English sentences. I'm trying to scan buf1 for newlines and then stop at the 1st newline and copy the rest of the data from that 1st newline into buf2.So I run a for loop to look for that new line.
Code:
for(i=0; i<1024;i++) {
if((strcmp(&buf1[i], "
[code]...
View 8 Replies
View Related
Jul 9, 2010
I am having trouble with the following exception class.
Code:
/**Standard Exception
*
*@description
*@update
*@changes
[code]....
Line 43 points at the snprintf() command.I think the error has to do with the function being virtual and the const after the function definition, however although I have been looking really hard I have not being able to find the reason nor the solution to the problem.
One workaround that I know is moving the block of source withing the virtual function, in the constructor, however having read around (boost library exceptions tutorials) it specifically said that formating of errors messages should not take place withing the construction of objects because we are risking throwing an exceptions and messing up the flow order.
View 11 Replies
View Related
Feb 14, 2011
i define variable of type char (range -128 to 127). when i tried to print the value after assigning a -ve value to it it displaying a +ve value of that -ve value(256+value).
View 3 Replies
View Related
Jul 5, 2011
With this I may remove the last emtpy char which is not visible, coming from net, windows, ...
Code:
echo "$mystringwindowsorotherwithemptylastchar" |sed s/.$//
However if there are not then it makes a problem and delete effectively an existing char.
Code:
echo "klklj" |sed s/.$//
klkl
Anyone would have a solution for SH?
View 2 Replies
View Related
May 6, 2011
Error: Cannot connect to the database because: INSERT command denied to user 'webuser'@'localhost' for table 'visitor'
[Code]...
View 3 Replies
View Related
Jul 5, 2011
1. lp file_with_english_chinese2. lp -ozh_CN.utf8 file_with_english_chineseThe normal ascii characer prints ok but the chinese character are blank.
View 4 Replies
View Related
Mar 4, 2010
is it possible to convert a variable from char * to unsigned char ?
View 5 Replies
View Related
Sep 18, 2010
I've been reading tutorials of Linux sed command, but haven't got anything yet. the problem is : I want to insert a line into my DNS database file which has a pattern like below:
<Domain name> 3tabs here <IN> <A> <ip address>
the question is : how to add a line into a file like this using linux sed command? I have problem inserting tabs and the spaces!
View 7 Replies
View Related
Jan 31, 2010
I have finally gotten Samba working! Turns out there was no domain set, even though I remember setting it during the install process...hich brings me to yet another question... Now that I have a mount command that works, how do I insert this such that it is run during the boot process? I want to automount a few Samba shares. Is this a good idea?If not why not? If so, where do I edit to add the mount command?
View 3 Replies
View Related
Oct 17, 2010
Is there a easy program that uses a GUI or am I going to need to do this from the terminal, either way I don't care I just need to be pointed in the right direction. I installed the 7zip package and started using it in the terminal but I can't figure out how to insert a password into my command. 7z x <package> [LOCATION] ?
View 9 Replies
View Related
May 31, 2010
Firefox seems to suddenly dislike one of the groups i belong too, whenever i try to access it I get the following message,
Database Error: INSERT command denied to user 'usingle_210259_1'@'linweb14.atlas.pipex.net' for table 'smf_log_online'
File: /websites/LinuxPackage02/si/ng/le/singlewithkids.co.uk/public_html/forum/Sources/Subs.php
Line: 2602
Is this a server error, or is it my system? I have tried using a different theme but I still get the same error.I'm using the gnome classic theme ATM.
View 4 Replies
View Related
Mar 10, 2010
i try do modify BASHRC and ENVIRONMENT files on directory ETCthen all the command don't work, such as:SUDO, GEDIT, NAUTILUS, NANO and some others!now i want to edit the 2 files and delete the insert lines
View 9 Replies
View Related
May 29, 2010
I've never programed shell scripting.
Code goes like so:
I simply want to read a file "data.txt" line by line Then char by char and add them into a result var. The file is supossed to always contain numeric values
View 8 Replies
View Related
Dec 10, 2010
How to find EOF char in file
View 1 Replies
View Related
Aug 24, 2010
the query is ||| how to append a char | string |||
#!/bin/bash
echo -n "one""two""three"
#END
above method is working well but below method is not working ?
#!/bin/bash
one=one
two=two
three=three
echo -n $one$two$three
#END
View 5 Replies
View Related
Oct 13, 2010
I want to call a application file in user space through a character driver running in kernel space.
View 1 Replies
View Related
May 21, 2011
i have problem executing lex program though the code is correct i'm getting some errors and the error says: In function yylex:
error: invalid operands to binary | (have char * and char *)
error: invalid operands to binary | (have char * and char *)
error: expected ; before { token
View 3 Replies
View Related
Mar 2, 2011
I am trying to understand the join command. I wish to join two files:
Code:
$ cat test1
a 0
b 2.51
c 19.85
$ cat test2
a 0
b 2.51
[Code]...
this is great but I do not understand why join ignores the -e flag and fails to insert FOO in the empty field.
View 1 Replies
View Related
Jan 18, 2011
I have a two column file and I need to create a new column in between the first and second but the new column adds a value to the first. E.g.code...
I thought I had figured out how to do it with the following but it just hangs:
awk -F '{print $0,$0+25,$1}' file_in > file_out
Also tried the following to no avail:
awk -F,-v OFS,'{print $0,$0+25,$1}' file_in > file_out
I can add the new column with the added value to the last column easy ( awk '{print $0,$0+25}' file_in > file_out).
View 8 Replies
View Related
Jun 8, 2011
I need to put headings on top of the output of this awk script :
#!/bin/sh
[Code].....
View 2 Replies
View Related
Apr 11, 2010
I've been using Vim for several months now via my web host (they allow putty access). All of a sudden, the escape key has become unresponsive. I cannot exist insert or any other mode by simply hitting escape. I have to hit F1 which brings up the help in vim and kicks me into command mode.
I'm most certain that my escape key on my keyboard is functioning fine since all of my windows shortcuts that use the escape key operate normally.
I know this is a ridiculous question and I'm certain there's a lot more to look into regarding a solution. What I really need is a solid lead as to where to start looking.
I'm using vim via putty I'm logging in using jailshell I'm not root
View 2 Replies
View Related
Aug 11, 2011
I'm a newbie on Linux and had to do something like this with the zip command:
My folder structure inside a zip file abc.zip is code...
It would move into abc.zip as folder3/textfile.txt (the hierarchy preserved)
Also used a -j switch (help said it junked the path info and it did but) - it would move only into abc.zip and sit at the same level as folder1 and folder2 instead of replacing the textfile.txt within abc.zip/folder1
My question is - I want to replace the abc.zip/folder1/textfile.txt with the one inside seconddir/folder3/textfile.txt.
How do I achieve this via the command line interface?
View 3 Replies
View Related
Mar 3, 2011
How do I get to insert mode in gedit? Why is there no documentation to do this? My Gedit comes up in overlay mode.
View 5 Replies
View Related