stuck in editing file with cat command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers stuck in editing file with cat command
# 1  
Old 07-22-2011
stuck in editing file with cat command

Hi,
While editing a small text file with cat command i pressed ctrl-d to send eof, instead of coming out of cat command it echoed ^D to the screen. Same thing is happening to ctrl-c. After googling i found this is because of trap.
The problem is i m stuck in editing mode and cannot get the prompt. Rebooting will help but i dont want to reboot the system.
Please help.
# 2  
Old 07-22-2011
Use fuser on file you were editing.
It should print out the process, use ps to confirm that's the one and kill it.
# 3  
Old 07-22-2011
i believe you are not in editing mode because the command cat can't be used to edit a file. try pressing ESC then colon ":" q!.
# 4  
Old 07-22-2011
Quote:
Originally Posted by Peasant
Use fuser on file you were editing.
It should print out the process, use ps to confirm that's the one and kill it.
It didn't help. whatever i input, it is entered in the file.

Quote:
Originally Posted by tamitot
i believe you are not in editing mode because the command cat can't be used to edit a file. try pressing ESC then colon ":" q!.
i used redirection feature to edit small file.
'cat > foo.txt'

This is what i found here by methyl
'From the command prompt, try this. Actually type circumflex C (not ctrl/c)
stty intr "^C"

Then try ctrl/c from the command line.

Then check for traps.

Just type:

trap

If you find a trap on INT or "^C", find out where it is coming from
.'
Thing is i could not get to the prompt.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

FTP stuck in 150 ascii after executing command

Hi, We have 2 linux RH servers (Server A and Server B), that were configured the same way. Same OS version, same ftp client, etc. The ftp client that we had installe, was downloaded from rpmbone site and the filename is: ftp-0.17-53.el6.x86_64 The permissions were already set up... (1 Reply)
Discussion started by: cees09
1 Replies

2. Shell Programming and Scripting

Stuck process when using sed command

$BIN/sql.py "select * from reporting.V_AMSNB_OPT_PB_LOAD" | sed -n "2,$ p" | sed "s/ /,/g" > $DATADIR/OPT_PB_LOAD_AMSNB.csv if The processes that get created from the above code gets stuck...as in the processes get created but then never completes. (or at least we assume it never completes... (1 Reply)
Discussion started by: mimiyj
1 Replies

3. Shell Programming and Scripting

Cat command not working to display Mac file in Ubuntu

Hi, Recently I got a .txt file from Mac user. when I try to open it in my Ubuntu machine using cat command it is not displaying any content of file however I can see the content using vi. Anyone know How to see its content using cat as I have to process it in my shell script. Thanks in... (4 Replies)
Discussion started by: diehard
4 Replies

4. UNIX for Dummies Questions & Answers

Cat command drops lines in output file

I use the cat command to concatenate text files, but one of the rows I was expecting doesn't display in the output file. Is there a verbose mode\logging mechanism for the cat command to help me investigate where the lines I was expecting are going?? cat 7760-001_1_*_06_*.txt | grep -v... (1 Reply)
Discussion started by: Xin Xin
1 Replies

5. UNIX for Dummies Questions & Answers

format values in a text file using cat command

Hello... Is it possible that we can change the format of the values we entered in a text file using cat? Like for example, I will create a text file names.txt using cat and as I save the names and view the text file... the format will be like this ... (5 Replies)
Discussion started by: kpopfreakghecky
5 Replies

6. Shell Programming and Scripting

problem in using sed command in editing a file

Hi all, I have a conf file, i want to update some entries in that conf file. Below is the code for that using a temporary file. sed '/workgroup=/ c\workgroup=Workgroup' /usr/local/netx.conf > /usr/local/netx.conf.tmp mv -f /usr/local/netx.conf.tmp /usr/local/netx.conf Sample contents of... (9 Replies)
Discussion started by: ranj14r
9 Replies

7. Shell Programming and Scripting

Extra control characters being added when I create a file using cat command

Hi, I am using Cygwin.I created a new file and type into it using cat > newfile. When I open this using vi editor, it contains loads of extra control characters. Whats happening? (1 Reply)
Discussion started by: erora
1 Replies

8. UNIX for Dummies Questions & Answers

Creating File using the CAT Command

Hello , I am newbie to UNIX platform . I have read that there are two ways of creating files that is using 1.) Cat 2.) touch . With Cat Command i am unable to create a File , i is saying No file or Directory exists I logged in with root as user . please help (7 Replies)
Discussion started by: Ravi Pavanv
7 Replies

9. Shell Programming and Scripting

cat in the command line doesn't match cat in the script

Hello, So I sorted my file as I was supposed to: sort -n -r -k 2 -k 1 file1 | uniq > file2 and when I wrote > cat file2 in the command line, I got what I was expecting, but in the script itself ... sort -n -r -k 2 -k 1 averages | uniq > temp cat file2 It wrote a whole... (21 Replies)
Discussion started by: shira
21 Replies

10. Shell Programming and Scripting

Single line file editing command?

Hello everyone. I have been reading a lot about the various different text editors at my disposal through Unix, but I just can't seem to close the deal for what I am trying to do. Is there a way to issue a single line command to edit a file where pattern=x, and do it non-destructively AND in-place?... (1 Reply)
Discussion started by: gator76
1 Replies
Login or Register to Ask a Question