I've done a little program, it's the snake game. I use an X window to show the snake and all that but the input is taken from the terminal. That means that what I have to do to play the game is open it with the terminal and then the game opens but then I have to go to the terminal again to move the snake. if I open the game from the GUI I can't do anything because it doesn't take my directions. What do I have to do in order to get the program to have a connection with my keyboard? I use getchar() to get the input, maybe there is something else?
I have sshed into a linux box and I'm using dvtm and bash (although I have also tried this with Gnu screen and bash). I have two terminals, current /dev/pts/29 and /dev/pts/130. I want to redirect the input from one to the other.And then when I type in /dev/pts/29 the characters I type should show up in /dev/pts/130. However what ends up happening is that every other character I type gets redirected.
display Chinese using gnome terminal I can input Chinese using VI thru gnome terminal but I can not input Chinese(Big 5) correctly on the command line I use scim/bridge as my input method
I really don't know what to call it, but I want to change the color of text that appears before you type in whatever your input is.
For example:
Code: negrabee@david-desktop:~$ ls /home/david/
I would want "negrabee@david-desktop:~$" to be in a different color. When you have whole bunch of commands and text in a full screen terminal, it gets really annoying to have to look for where you're entering the command so changing the color.
1.) Whenever i am starting a new instance of terminal, it is giving messages 'unable to read input images' five times. Actually i had run a shell script that gave this message, but why is it appearing every time, i am opening a new terminal, (that script is already over and it generated the required outputs)? Because of this, when i run 'ls' command, it is showing all the files and directories with the same color, otherwise it used to show them in different colors.
2.) Once my panel had crashed, then i have made a new panel, but after that my instant messenger icon is no more keeps sitting on the system tray as it used to do before, it closes as i close its window otherwise even after closing the window, it used to keep me logged in and the icon use to be there at system tray.
3.) automount for usbdrive not working? Note: all these problems are there only in my own user account. Other user account like root and guest has everything correct.
I'm trying to get a script to open a gnome-terminal and input commands into it, just as you would typing them in. That way, I can automate commands using bash, even if the terminal is running a non-bash program like telnet, mysql, vim, etc.
So, for instance..
I would like to open telnet to connect to a mud (I'm aware of the security concerns) and input commands through a script.
This way, I can log in, enter name/password, and do some start-game stuff automatically.
This isn't just for a mud, though. I'd like to be able to script inputs for any terminal application... maybe automate vim, mysql, or whatever.
I recently started shell programming and my task now is to do a menu display.Currently i am stuck whereby user will input both title and author and it will delete it.
when I call a windows application with wine I cannot type anything when the application asks for it. The typed keys are displayed in the terminal instead. I use a ubuntu-based distro.
While I can find my way around most things, terminals and desktop managers are different than I remember. One of the biggest problems that I am encountering today is that when running a gnome terminal (this is Suse 10.0 enterprise), I'm getting behavior in the window that I don't want. Specifically, when I type, my typing is underlined as if something is trying to spell check my window. Further, it seems as if when running vi or less, my keystrokes are only processed by these apps when I hit 'return'. I.e. if I'm running less and want to go back a page, I'll hit b, but nothing happens until I hit 'return'.
I seem to have tracked this down to the 'input method". Right clicking in the Gnome terminal allows me to set my input method to one of a dozen values. It seems that currently, it's set to "SCIM Input Method". If I then select 'default' or 'X Input Method', apps (i.e. things like less, vi, and even the bash shell) behave as I would expect.
a) what is this SCIM input method
b) how can I make it so that it is not the default?
I've poked around various configuration files in my home directory as well as in /etc, but I can't see to find how this is set.
I'm trying to create an iso file in a terminal with the following command: $cat /dev/sr0 > nameofdisk.iso I get the following error cat: /dev/sr0: Input/output error I already checked and my optical drive is indeed /dev/sr0. I've hunted google a few hours trying to figure it out. Does anyone know why I'd be getting this error?
I've got used to using the ftp command from the terminal, which is useful, especially with macros. But it requires user input, and what I want to do now is upload a specific file to a server, once I've finished working with it every day. It's the same file every day. II would like to be able to do this semi-automatically: I just give the command and it connects to the server and uploads the file. (I will probably want to encrypt the file before uploading it.)I don't know how I could use ftp without any user input: I want it to be automatic.
As i am new to C++ i couldn't figure out how to input a file and make some change on the file and produce a output file. like this problem i have is.
"Program that processes an input file and produces an output file. The input file will contain lines of data, each containing two floating point numbers. The lines of the output file should contain the two numbers read and their average (with a '$' sign and 2 places after the decimal point)."
I'm trying to make a program to simulate a parabolic movement, so i've added 2 entries, one for the initial velocity and other for the angle, anyway you probably don't care about that xD what i want is to take the number entered in the entry and put it in a variable to do the math, and then show everything in a dialog or something. how do i do that?
what i am trying to do is to allow the user to key in data such as "23.23" or "24" , as it is the price of certain objectsHow am i able to design a check which will allow me to prevent users from typing in input such as "ab.21" or "rfrr" as this field is purely a numerical field. The problem i am facing is i tried using this search code.
right now i am writing bash script for simple everyday todo tasks.script consisit of two files, fisrt is just script (which can delete/append /clear) and second one is todolist.txt which stores my notes.I am litlebit confused about sed!!for example, If my todolist.txt have these lines:
- Writing my Homework - take my girlfriend to launch - Take a break
How can sed take my input $@ and delete all line with name "Homework"..i trayed with many sed combination like:
Code: sed s/$@//g sed 'd/$@/' and many more combination with ""/'' or bracket but nothing helped
I've written a bash script that allows a user to input a directory location to find out the size of the directory. However, if the user inputs a directory and finds its size then inputs another directory then wants to quit, the script asks the user numerous times if he wants to quit!! The script won't exit until the number of times the user looks at a directory is reached! What gives?
I am trying to learn C++.I implemented a simple archive program, and I am in a situation in which the user is prompted by a menu to make a choice.So I have some cout instruction to illustrate the possible choices and then
int choice; cin>>choice;
and everything works fine.I introduced this code in a "while" loop that checks wether the choice made by the user is valid or not:
bool check=true; int choice; while(check) { cin>>choice; if(the choice is valid) {...;check=false} else cout<<"please make an other choice" }
What is happening is that if by mistake the user introduces a character in place of a number, the loop repeats indefinitely because the program, when it get to the "cin" instruction, does not pauses to wait for a new input.
I would like to create a small C tool. I encounter a problem of how to make a function to check an input chars contains numbers (started from the second element).
Some samples:
char *mychar= "a3547"; (The result of function checking this is true) char *another_char = "t6548"; (The result of function checking this is true) char *next_char = "appl3"; (The result of function checking this is false) char *new_char = "b1aa3"; (The result of function checking this is false)
Write a program that requires the user to input the name of a file as an argument. If the user fails to include one argument it should make use of a thread that handles a signal. The signal handler should tells the user Incorrect number of arguments and then calls the terminate signal on the process.
If the numbers of arguments are correct then the program should allocate memory space to the file (5MB) and create a child process that requests the user for a character that it should send to the parent. The child should keep request for data until the user keys in the character O. During each request it should pause for 10 seconds, send the character to the parent and then requesting again for another character.
The parent should get the character from the child. Do not make the parent wait for the child to finish requesting for data. Make use of pipes to facilitate communication between the parent and the child. A second child should be created to read and display data from the file. Make use of any appropriate Inter Process Communication technique to ensure that the second child and the parent do not access the file simultaneously (Mutual exclusion).
i have to write a program which checks the information inside a text file to make sure it is all integers and then convert the integers to roman Numerals. My program seems to have a bit of a problem and im not sure where exactly the problem is....
I started to run a C++ my program in Linux and I don't know how to test my program that works fine with a text file. This is a project for my uni and to explain more clear, My program is a sample database for modify or add and search and it read data from a binary file and also write into a binary file. I have got an input from my lecture and she said after compiling in Linux I must write:
1-to compile: Code: g++ (files with cpp) 2-to see the output: Code: ./a.out 3-to test with input: Code: ./a.out < input.txt >
My problem is in step three. What I must write in the command part after" step2" to see the output?
I have a C program that may finish in seconds or weeks depending on the data. For the longer jobs I want to be able to press a key and get an intermediate result printed.
I have this piece of code in my shell script file: Code: useradd $UserName; passwd <& $password I am not able to perform Input Redirection while setting password programatically- without any user intervention. I think there is a way to do it, but it is just getting slipped from my mind at the moment.
I'm writing a program which now accepts user input:
Code: echo "Enter a date in the format YYYY MM DD hh mm ss."
read gregyr gregmo gregdy greghr gregmn gregsc This lets the user input a date and time, such as 2011 06 21 15 12 45, and have each number assigned to their corresponding variable. Later in the program, these variables are put into an equation, and then the terminal spits out the answer. Now I have to have the program read all of the lines from a text file, which is in this format, assign the variables.
As I'm starting to learn bash scripting I'm trying to automatize some tasks I usually perform. I have a notification mail I need to send several times a day. It has this structure:
Quote:
Dear user, blah blah blah blah
You need to contact the following people:
[code]...
To replace "user", I found this:
Code:
read -p "Please enter username: " username echo "Dear $username,"
Which probe to be very useful with other simple notifications like this. But I don't know how to manage the email addresses as they are usually more than one and could vary from 1 to 10. They should appear one above the other. I found this: "Here is a little work around. The only thing the user needs to do is hit enter without anything else on a line and it will close out"
Code:
#!/usr/bin/ksh word=a until [[ $word = "" ]];do
[code]....
I tried to use it and modify for my needs but I failed, I don't realize yet how can I use it. If possible, I would like to use the until loop like the above example just for learning purposes but any other form will be accepted as well.