01-24-2005
reading a single character in C
Can anyone help me?????
My problem is that i want to read only one charcter from keyboard. Each time my program waits to press enter or ^d. I don't want that. As soon as i press a charcter it should proceed to next statement in program without pressing enter or ^d.
please help me..........
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hello,
i need an algorithm which reads a line specified to it in shortest possible time.
i am already using sed, i need a better way. please suggest me alternatives (2 Replies)
Discussion started by: rochitsharma
2 Replies
2. Shell Programming and Scripting
I know this is strictly a programming forum - but I consider vi a programming enabler and the question relates to regex you'd use with awk/sed anyway....
I have a file which is 50,000+ lines long and need to change many many instances of
word_word_word
to be
word+word+word
where... (6 Replies)
Discussion started by: Brett Taylor
6 Replies
3. Shell Programming and Scripting
Hi,
Is it possible to read every 2 lines as single record, I have a file like below,
~CZK ~TSCHECHISCHE KRONE ~TSCHECH. REPUBLIK
Dec 1 2005 12:00AM~ 10.840000~
~DKK ~DAENISCHE KRONE ~DAENEMARK
Dec 2 2005 12:00AM~ ... (9 Replies)
Discussion started by: braindrain
9 Replies
4. Shell Programming and Scripting
Hi,
I should read one character at a fixed position from each line of the file. So how ??? should be substituted in the code below:
while read line ; do
single_char=`???`
echo "$single_char"
done < $input_file (8 Replies)
Discussion started by: arsii
8 Replies
5. Shell Programming and Scripting
Hi all,
Greetings,
I have the following scenario, The contents of main file are like :
Unix|||||forum|||||||||||||||is||||||the||best
so||||||be|||||on||||||||||||||||||||||||||||||||||||||||||||it
And i need the output in the following form:
Unix=forum=is=the=best
so=be=on=it
... (3 Replies)
Discussion started by: dipanchandra
3 Replies
6. UNIX for Dummies Questions & Answers
Hello every one and thanks in advance for the time you will take to think about my problem.
I would like to know if it's possible (in BASH) to read a text file character after character.
Exactly this is what I would like to do :
Txt file : ATGCAGTTCATTGCCAAA...... (~2.5 millions... (3 Replies)
Discussion started by: sluvah
3 Replies
7. Shell Programming and Scripting
Hi friend,
i have the following problem:
when i am writting the below command on the command prompt , its working.
while read -n 1 ch; do echo "$ch" ; echo "$ch" ; done<file_name.out.
but when i am executing it after saving it in a ksh file, its not working.
Please helppppppppp .. thankss... (18 Replies)
Discussion started by: neelmani
18 Replies
8. Shell Programming and Scripting
Hi All,
Below is a sample command that I can run without any problem in the command line.
Command Line
dtToday=`date +%Y%m%d`; ls -ltr ./filename_${dtToday}.txt
-rw-r--r-- 1 monuser oinstall 0 Jan 18 11:02 ./filename_20130118.txt
But once I put that command line in file (list.txt) and... (3 Replies)
Discussion started by: padi
3 Replies
9. Shell Programming and Scripting
Hi All,
I am trying to read a file character by character,
#!/bin/bash
while read -n1 char; do
echo -e "$char\c"
done < /home/shak/testprogram/words
Newyork is a very good city.
Newyorkisaverygoodcityforliving
I need to preserve the spaces as thats an... (3 Replies)
Discussion started by: Kingcobra
3 Replies
10. Shell Programming and Scripting
I have a csv dataset like this :
C,rs18768
G,rs13785
GA,rs1065
G,rs1801279
T,rs9274407
A,rs730012
I'm thinking of use like awk, sed to covert the dataset to this format: (if it's two character, then keep the same)
CC,rs18768
GG,rs13785
GA,rs1065
GG,rs1801279
TT,rs9274407... (7 Replies)
Discussion started by: nengcheng
7 Replies
LEARN ABOUT MOJAVE
gitaction
gitaction(1) General Commands Manual gitaction(1)
NAME
gitaction - GNU Interactive Tools - per file type action script
SYNTAX
gitaction directory file
.gitaction directory file
DESCRIPTION
gitaction is a script that executes a different action for each file type specified. It is called by the gitfm program when pressing F2 or
^Xa (see the gnuitrc.TERM configuration files in the gnuit manual). The first parameter is the current directory name and the second one is
the file name to be matched against the default patterns. The matching is done using the shell 'case' statement. If you press F2 or ^Xa on
a *.html file, gitfm will invoke a browser to view it, if you press F2 or ^Xa on a *.tar.gz file, gitfm will list the tar archive contents,
if you press the same keys on a *.gz file, gitfm will display its uncompressed contents on the screen, etc ...
If you press F2 or ^Xa on a *.gif file or *.jpg file and you have the zgv utility installed, you will be able to see it. If you want to
change the gif/jpeg viewer, all you need to do is to change its name in the gitaction script.
There are many more file types and viewers that gitaction knows about. In addition, if you are running under GNOME, gnome-open is used,
and on MacOS, open(1) is used. see(1) and metamail(1) are also used as fallbacks.
If all else fails, the file is displayed using $GNUIT_PAGER. Feel free to change this. If you want to find out what the default action for
each file type is (or if you want to modify it), just read/modify the gitaction script.
The script can be easily enhanced. Just read it.
The .gitaction script is a local version of the gitaction script. When started, gitaction tries to search a script called .gitaction in the
current directory and, if it finds it, it starts it. If .gitaction's exit code is 0 ( .gitaction couldn't find a matching pattern), gitac-
tion starts its own case statement trying to match the current file name (the second parameter) against its default patterns.
The .gitaction script *must* be executable. An example of .gitaction can be found in the directory gitfm is installed into. (usually
/usr/local/bin or /usr/bin) Debian users can find it in /usr/share/doc/gnuit/examples/. You should copy the example to the current direc-
tory or your home directory and then modify it.
BUGS
Please send bug reports to:
gnuit-dev@gnu.org
SEE ALSO
gitfm(1) gitps(1) gitview(1) gitmount(1) gitkeys(1) gitrgrep(1) gitunpack(1)
AUTHORS
Tudor Hulubei <tudor@cs.unh.edu>
Andrei Pitis <pink@pub.ro>
Ian Beckwith <ianb@erislabs.net> (current maintainer).
gitaction(1)