Programming :: Find What Is Displaying In A Terminal?

Jan 23, 2011

Is there any way to find what is displaying in a terminal in C language?

I want to automate ssh login process, I know that I can use "expect" but I want to write another program in C myself.

In first ssh try to a host, ssh prints a message like this:

Quote:

The authenticity of host '192.168.30.1 (192.168.30.1)' can't be established. RSA key fingerprint is **** Are you sure you want to continue connecting (yes/no)?

and waits for an answer. I want to enter "yes" programatically when the message appears, but I don't know how to find if the message is appeared or not. In this case problem can be solved in another way, deleting the entry of the host from ~/.ssh/known_hosts before executing the ssh command, sleeping for one or two second and entering yes. Same problem exist for password prompt and this can be solved by sleeping, too.

But it is not a general solution and can be failed if prompts appear after entering required keys.

View 8 Replies


ADVERTISEMENT

Programming :: How To Find Out Width Of Terminal

Mar 19, 2010

I wonder how CLI applications know the width of the terminal. For example, how does ls know how many columns to use?

How do package managers like pacman know what length to make the download progress bar?

Also, how do they redraw the progress bar in the same line?

View 11 Replies View Related

Programming :: Socket Programming While Displaying Received Message In File

May 11, 2011

i have problem in socket programming, while displaying received message in file,i got a problem... i cant able to write it in the file.... this is the code....

Code:
/* tcpserver.c */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
[Code]....

now my problem is run time error i can able to create file but i cant able to write file....log.txt contain nothing.... as here i have give sample code... dont say not initialising function and all.... i have initialised , please only see func1() - my problem is only not able to write msg which i got received from the client..

View 2 Replies View Related

Programming :: Using Awk For Displaying Of Row?

Jan 24, 2010

Code:

Database
rina lives:fatin:20:20:20
rina:fatin:20:20:20

i am having a small problem in extracting out the information from the database. For example, if i were to input a book titled rina into my search , i would only want it to display the row which has the title rina, like this

Code:

rina:fatin:20:20:20

but when i use a coding like this :

Code:

grep -i "$Title" fruit| awk -F":" '{ print $0}'`

its displays both titles and their information

Code:

rina lives:fatin:20:20:20
rina:fatin:20:20:20

for some reason, it will read both rows as both contains the word "rina".

View 8 Replies View Related

Programming :: Displaying The Information Using Awk?

Jan 14, 2010

i am using awk to display my information in a certain order.

Database :

Code:

Persia:42:John
France:50:Mabel
Persia:50:Rach
Germany:60:John

My expected output is :

Code:

Title Price Author
Persia 42 John
France 50 Mabel

[code]....

I tried using cut command but it also gives me the same problem. If i do not assign it to a variable, how am i able to format it to display it in the correct format?

View 4 Replies View Related

Programming :: Displaying Unicode Characters

Feb 19, 2011

I wrote a java program that writes strings to a file. The strings contain foreign language characters. When I run the program in Windows, the output file shows the foreign characters. However, when I attempt the same operation in Linux, the output file shows a white question mark in a black background instead of the foreign characters. The same Linux system could display the foreign characters if I copy the output file from Windows to Linux. I tried to create the output file using gedit that my program would then add additional strings to and chose Unicode-32 for encoding but still the same problem.

What could I do to get the program to display the foreign language characters from output text file?

View 6 Replies View Related

Programming :: Displaying Particular Lines Via Grep ?

Apr 8, 2011

So For example I run this command:

Code:

But want to gerp / cut it in such a way that it only displays

Code:

Now the thing is that these 3 lines are not static.. there can be N number of lines there.. the only thing is that I want the command / output NOT to display the first line but the rest of the n lines ..

View 9 Replies View Related

Programming :: Displaying A Maze Generated By A C Program ?

Oct 8, 2010

I want to write a program in C which will generate a maze randomly and find the solution for it ..

The idea behind is in [url]

How the 16 bit integer is stored in a variable...Earlier I wrote a program on trees and displayed it using dotty...Is there any such tool to display a maze...I am using ubuntu 10.04

View 1 Replies View Related

Programming :: Java Applet And Displaying Text

Mar 13, 2010

Im having various problems with the graphic printing features for applets.

In this immediate applet, when I print and update the previous line bleeds through the next line. I tried printing a series of spaces to clear the first text, but it doesn�t work.

Code:

View 8 Replies View Related

Programming :: Displaying I/O Possible When Reading Data From The Serial Port?

Aug 31, 2009

I have got a problem while reading from the serial port. I'm working on iMX-31 board and Eclipse IDE. Whenever I'm trying to read any data through the serial port, it's displaying I/O Possible and the application is being terminated. After reading I'm trying to write this data on a file. Here are the excerpts from the code:

# int main()
{
if (openport()<0)

[code]...

View 7 Replies View Related

Programming :: Redirect The Output To Multiple Files Without Displaying It To The Screen?

Oct 26, 2010

To redirect standard output to multiple files:

Code:

echo Test | tee file1 file2

My problem is that the word "Test" still displays to the screen? I want same effect as:

Code:

echo Test > file1

but with multiple file redirection.

View 3 Replies View Related

Ubuntu :: Unable To Find The "Programming" Menu And The "Terminal"

May 4, 2011

I have just upgraded to 11.04 from 10.10. I am having the following problems noticed. I'm unable to find the "Programming" menu and the "Terminal". Also the right mouse button responds just like the left mouse button in fire fox.

View 1 Replies View Related

Programming :: Displaying The Contents Of Buffers In A Protected And Non-protected Critical Section?

Nov 19, 2010

I have this project for my operating systems class and I have put together the basic flow chart to aid me in writing the program. I know how to use pipes as a buffer to hold info. I know how to create a binary semaphore. But what I dont know is this:

How to "use a delay adjustment parameter K in the critical section to adjust the speed of the display process to show that without semaphore protection the displayed contents of the buffer are randomly interleaved."

First off, I am definitely not asking anyone to give me the solution. But I do need some guidance. So I figure there will be an if statement with two options:

1. If true, use semaphore protection to enter/exit critical section

2. If false, no semaphore protection -- this is where the contents of the buffer should be interleaved.

Now does that mean that as each child process enters the non-protected critical section, it should "sleep" for a randomized time? I mean, will this allow my output to be interleaved?

So lets say my command line looks like this:

what happens to the 100? Is it randomized using rand and srand and passed as a parameter to sleep() inside the critcal section?

View 5 Replies View Related

Programming :: Implement A System Call For Displaying The System Statistics

Nov 6, 2010

I have been assigned to implement a system call that report the system statistics over all memory which are

Total Pages in Active LRU list
Total Pages in Inactive LRU List

View 1 Replies View Related

Programming :: Displaying Process Id In Shell Script But There Is No Such Process?

Nov 9, 2010

I have a shell script to identify whether the process is running or not. If the process is not running, then I execute another script file to run my application. Below is my script and saved this script as monitorprocess.sh Code: #!/bin/bash

result=$(ps -ef | grep -v grep | grep "applicationname.sh" | awk '{print $2}')
echo $result
if [ "$result" == "" ];

[code]...

View 4 Replies View Related

OpenSUSE :: Cannot Find A Terminal

Aug 26, 2010

I have installed Open Suse 11.3, after giving up on Ubuntu when the latest version would not connect to the internet. In Ubuntu I could always open a terminal to carry out any command line task. In Suse I simply cannot even find one.

I need to find a terminal that I can run in Root in order to load some firmware for a different network adapter, as I am currently using one borrowed from another computer.

View 9 Replies View Related

Ubuntu :: Find By Type From Terminal?

Jun 27, 2010

I'd like to find all files of a specific type (as determined by the terminal "file" command) from the command line ... and haven't been able to figure out a way to do so. For instance, I'd like to be able to find all JPEG files in my filesystem, even if their names don't end in .jp*. It would be helpful to be able to combine this with other tests in find, so that I could type something like "sudo find / -atime 0 -size +1M -type adobeflash" or something like that.

I've looked for ways to hook find up to file and tinkered around with a few ideas involving pipes, but nothing seems to get what I want.

View 2 Replies View Related

Ubuntu :: Find Out Displays From Terminal?

Aug 20, 2010

I need to show which Display is online on X if i have 2 Graphic Cards ,how to find out which is display 0.0 or 0.1 ex.

View 2 Replies View Related

Ubuntu :: Can Not Find Terminal For CLS / Resolve This?

May 29, 2011

I can not find Terminal for CLS in Ubuntu 11.0.4. Where is it located in 1104 version.

View 3 Replies View Related

General :: Can't Find Terminal In Zorin

Aug 5, 2011

I've just installed Zorin 64 bit and want to make some changes and install some new packages using apt-get but i've been through the whole start menu and can't find a terminal.

View 1 Replies View Related

Programming :: Unable To Find Description Of Alsa's Programming Language

Dec 19, 2008

I am unable to find a description of alsa's programing language, this sort of stuff:

[Code]...

I need to know what, for example, 'ttable' means and what is its syntax. This seems to be a state secret.

View 2 Replies View Related

Debian Multimedia :: Command In The Terminal Can't Find Anything?

Aug 11, 2010

I just decided I'd give Google Chrome a try. Installed it via the google repository and it went fine.

However, every now and then it just vanishes from my menu and it can't be found again, also the command in the terminal can't find anything.

So, what's left is to reinstall it, and during reinstall it doesn't even whine about already being installed.

Anybody else with this matter? I am running 64-bit Squeeze.

View 11 Replies View Related

Ubuntu :: Bulk Find & Copy In Terminal?

Mar 29, 2010

I have found KRename to be very useful for bulk find and renames; however, I'd like to do a find a copy, which KRename doesn't appear to do.

For example, I'd like to (case insensitively) search all subdirectories for files called "cover.jpg", "cover.gif", or "cover.png" and create a copy of these called "thumb.xxx", in the same subdirectory the original is found, with the same extension as the original.

View 4 Replies View Related

Ubuntu :: Find Wireless Networks In Terminal?

Jul 29, 2010

I like to do a lot of my tasks through the command line, and was wondering, is there a way to see all the wireless networks available in the terminal? I tried 'iwlist scan', and it said all the interfaces do not support scanning. Is there anything I can do?

View 2 Replies View Related

Ubuntu :: Find Specs On Computer With Terminal?

Oct 28, 2010

I would like to find out the specs of the computer, however I did build the computer from components myself so I can't google anything to find out specs.

View 8 Replies View Related

Software :: Cant Find To Run Dosbox In Any Of The Menus Or From Terminal?

Jul 31, 2010

i'm running slackware 13.0. i've installed dosbox package and the installation process showed no errors,but now i cant find how to run dosbox in any of the menus or from terminal.

View 2 Replies View Related

Fedora :: Terminal-based Programs Won't Run Because It Can't Find Libtermcap

May 30, 2010

I installed Fedora 12 on a new machine (Intel Core i3) and one of my terminal-based programs won't run because it can't find libtermcap. The specific error is

Quote:

error while loading shared libraries: libtermcap.so.2: cannot open shared object file: No such file or directory

I seem to have this problem every other time I install a new Fedora. I tried a few things with old libtermcap files from other machines, and I tried looking around the YUM repository, but nothing seemed to work.

What's the proper way to get the libtermcap libraries for a Fedora 12 machine on an iCore i3?

View 1 Replies View Related

Fedora :: Gnome Terminal Randomly Can't Find All Files

Aug 18, 2011

yesterday I tried to convert a file with ffmpeg and as usual I type the first letter of the file and hit tab to auto complete and nothing happened, I then cut and pasted the file name, no such file or directory I have 41 files in ~/videos and if I hit tab without choosing anything gnome terminal gives me the choice of just 1 file, ok just tried it again first time only 1 file second time 4 different files 1st file can't be found. I can't do anything from the command line, is anyone else seeing this odd behaviour ?

Edit: I just installed aterm and gnome terminal found some more files and now can't find them again, aterm seems to be removing the first 4 letters and replacing them with spaces

View 3 Replies View Related

Ubuntu :: Find A Complete List Of Commands For The Terminal?

Jan 24, 2010

Were can I find a complete list of commands for the terminal in ubuntu linux 9.10

View 9 Replies View Related

Ubuntu :: Can't Find A Keyboard Combination To Start Terminal

Oct 30, 2010

No menu, can't find a keyboard combination to start terminal. Ubuntu 10.10 32 bit. Do I have to re-install?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved