Programming :: Two Text Consoles On The Same Physical One?
Jun 27, 2011How large would a program have to be to open two text consoles on the same physycal console? And what would the general outline be?
View 9 RepliesHow large would a program have to be to open two text consoles on the same physycal console? And what would the general outline be?
View 9 Repliesi am on processing text tasks And i found that if you assign a text to a variable is chomp'ed automatically the newline
Code:
variable=$(cat file.txt)
The problem is i can only access the items/lines using:
Code:
for line in $variable
do
echo $line
# Other commands
done
how do i convert this to an indexed array. More importantly, how do i get access to individual $line[0], ..., $line[n] Another thing, if the file.txt, has lines with spaces it is a mess using the for...in..., but echoing prints line by line...o_0
How do I get the page pointer from a physical address?
View 1 Replies View RelatedI need to insert 3-4 lines of text to the beginning of a text file. The file is a largish MYSQL dump, the result of a backup shell script. This shell script should insert the required text.I've wrestled with sed, but lost.
View 2 Replies View RelatedI have to delete a certain line of text from the a textfile via ubuntu's shell scripting.I have done research, and it seems that most people advocate the usage of sed /d option. sed makes does not edit the text file. Hence, most options I discovered involved the use of a temporary variable/textfile and then overwriting the old file with the temporary new file. Is there anyway whereby I can bypass the use of temporary storage containers? I hope there is any magical combination of commands to edit the file directly.
View 3 Replies View RelatedI want to display something in my text view widget in glade using c code. that's all right.
now I need to attach a save button beneath the text view.so that on click the text view content should save as a txt file..
I want to display the contents of a particular log file (simple text file, I mean in Linux). But there is a problem: The contents need to be organized in a fixed format. Have a look at this log file:
sampleLog.txt
Code:
User Name: XYZ
Reported Problems Description: Blah! Blah! Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah!
[code]....
So, while displaying the contents of above file on a web page, I want to format the field names found in the log file: User Name:, Reported Problems Description:, and Remarks:. These fields may contain a variable length of text and no specific line number is assumed for them to appear on.
The desired output should look like this:
User Name: XYZ
Reported Problems Description: Blah! Blah! Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah!
[code]....
Well, what I am trying to do may sound wierd to some of you. The filed "Reported Problems Description:" can possible contain text which embeds colon (.
I am trying to find sed command combination to print out the "start command" line, the id line and all lines between "details" and "stop command" only if "error" exists. Here's the original output (test.txt):
start command
id 1
kajsdlfjsalj
[code]...
a sed command to add a text before line number in text file? I have text file with 500 lines, and i want to add 3 more lines with text after line 300, OR before line 302, isn't no problem.
View 16 Replies View RelatedI allocated a chunk of memory using kmalloc in a Device Driver. Kmalloc provides a pointer to the allocated memory. This is one of my first few drivers.
I assume that the address returned is a Virtual address. I need to find the physical address of the memory location. I am working on an Intel 64 bit Fedora machine. I used the virt_to_phys() routine present in <asm/io_64.h>. I found that this routine returns an unsigned long value (32 bit) instead of an unsigned long long value (64 bit). Moreover, it seems that it simply returns the address - OFFSET instead of extracting the value in the page tables.
So is there any function / system call in Linux which will allow me to see the actual physical address on the Intel 64 arch.
How to printing physical address of page directories for all processes?
#include <linux/module.h>
#include <linux/init.h>
#include <linux/sched.h>
[code]....
Whenever I'm running my application process, I've 1M physical memory usage is increasing for every 2 hours.This I observed using 'free -m' command.But 'top' command did not showing any increase 'RSS' size.It is same as it was started initially.Even though I stopped my process,the increased memory was not released back. If I start my application process then again memory usage start increasing by 1M for every 2 hours. increase of memory usage observer with 'free' and that too when my application is running, but top command is not showing any change in the RSS sizeIf my application is leaking any memory which is allocated by new/malloc, that should be released back whenever my application exit and the size increase will be show through top command for that process, right? This is not happeningThis proves that there is no potential leaks in my process.But why physical memory is increasing when only my process is running?
View 14 Replies View RelatedI have a text file called file1.txt containing many lines eg.
line1
line2
line3
line4
line5
line6
Then i have another text file called file2.txt contains
3
5
6
Is there a command to remove the lines in file1.txt based on the keywords in file2.txt? note: It should remove line3,line5,line6 based on 3,5,6
I need a small shell based program that prints the mac address of physical ethernet adapter from it's firmware. I need this utility for license generation and appliance activation. I have tried several example but none of them is flawless, The easiest method I have found is to parse the output of "ifconfig" command but it has also some drawbacks.
1. Firstly program should differentiate between physical and virtual adapters. Physical means installed on board(wired or wireless) or installed additionally. Virtual adapters are those created by VPN or created by virtualization apps such as VirtualBox/VMWare etc. I am not interested in virtual ones.
2. In case of more them one physical adapters(wired and wireless), it should print the mac address and description(name & vendor) of both/all adapters.
3. If media is disconnected then also it should be able to read the mac address and description(name, vendor) of card.
4. This one is bit complex. I know that 'ethtool' can show you the universal mac address but it's limited to use only 2 types of drivers and won't work in all cases.
I want to translate the virtual address to physical address in linux C application, how to do that?
View 1 Replies View RelatedWhen I try to access at physical address (0xD0000), we known that it is necessary to convert physical address to virtual address using function IOREMAP(0xD0000, 1024) and return me 0xC00D0000.
Now our doubt is when I have a board with I/O in address 0x150, is it necessary to convert this address to other virtual address??? or with inb(0x150) return me state of I/O in this address? How can I known where is this I/O address in my map memory?
I'm building a web kiosk and I'm trying to figure out how to disable the ability to switch to tty2-6. All the references I've found refer to a process on older versions of Fedora.
View 11 Replies View RelatedI am gradually getting used to the CLI for Ubuntu. I am used to switching between windows when editing a file, going to the command line to run a cmd, and then back again etc.
I feel severly restricted by the CLI, as it seems I can only do one thing at a time. Surely, there must be a way where I can 'switch between' several command line consoles?
Also, I am using vim, and I sometimes need access the command line. At the moment, I have to quit vim to get to the CLI, and then start vim again. This is not very productive.
How to switch between CLI screens/consoles and also how to switch to the CLI from withinin vim and then back to vim again without having to close vim?
My distro is Ubuntu Lucid Lynx (10.04 LTS)
The problem is: CTRL-ALT-F1 etc does not give me the login consoles and i strongly suspect it has something to do with the notebook display adapter (a problem on its own, but in this case it seems to be the INTEL GMA).After pressing the key combo, the HD is working on something, but all I get is a frozen picture of my current (tty7) Desktop. After hitting CTRL+ALT-F7 it blacks out for a moment, comes back to normal gnome Desktop as if nothing happened.I tried setting different vga modes in grub (according to my research, this also sets tty consoles modes ?) with no luck.The output of 'hwinfo --framebuffer' is as follows (if it's of any help):
Code:
02: None 00.0: 11001 VESA Framebuffer
[Created at bios.464]
Unique ID: rdCR.7IS+B23HFDE
Hardware Class: framebuffer
[code]....
I've just upgraded to a new monitor, that has a default resolution of 1920x1024. How do I set Grub2 and consoles to use 1920x1024? Right now I can't use any console (Ctrl-Alt-F2). I'm using Ubuntu 10:04 x86_64.
View 5 Replies View RelatedI am attempting to setup linux in my embedded environment. I wanted to output the console display though the tty serial port and the vt. Since I don't have a frambuffer hw driver yet, I just wanted to use the vfb as a temp.
So, this is what I did in my configuration file:
CONFIG_CMDLINE="console=ttyS0,115200n8 console=tty0 mem=126M video=vfb:"
CONFIG_VT=y
CONFIG_FB=y
CONFIG_FB_VIRTUAL=y
CONFIG_DUMMY_CONSOLE=n
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_VGA_CONSOLE=n
I would expect the tty output to go to the uart as well as the virtual-console; this does not seem to be the case, as no vt functions are called when I execute prompt commads - I can see the console in my serial terminal, and this all works fine.
Here are extracts from my boot:
Kernel command line: console=ttyS0,115200n8 console=tty0 mem=126M video=vfb:
...
Console: colour dummy device 80x30
console [tty0] enabled
...
Console: switching to colour frame buffer device 80x25
fb0: Virtual frame buffer device, using 1024K of video memory
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x3e000000 (irq = 99) is a 16550A
console [ttyS0] enabled
serial8250.0: ttyS1 at MMIO 0x3e001000 (irq = 9 is a 16550A
serial8250.0: ttyS2 at MMIO 0x3e002000 (irq = 97) is a 16550A
...
Here are my console binding results:
/ #
cat /sys/class/vtconsole/vtcon0/bind
0
/ # cat /sys/class/vtconsole/vtcon0/name
(S) dummy device
/ # cat /sys/class/vtconsole/vtcon1/bind
1
/ # cat /sys/class/vtconsole/vtcon1/name
(M) frame buffer device
/ #
I recently installed RHEL 5.2 on my system. I found that I was not able to show up virtual consoles that we generally do by hitting Ctrl + Alt + F1 through F6.
I installed Red Hat again but the same problem is there. However, I can go into Run Level 3 by
Code:
init 3
but it takes too long to display the prompt. Besides, hitting Ctrl key generates error "unrecognized key" something like that.
Today I installed Virutal Box on Windows XP Host. Then I installed RHEL 5.2. There also I faced the same problem.
However, Virtual Box works fine and I am glad that I can now have only one Host OS on my system and then install as many Guest OSes as I want. Dual Boot System was giving me a heacdache.
On the weekend I installed and played Crayon Physics Deluxe, and when I closed it it caused some graphics problems. I thought nothing of it and shut down the system. When I next booted the computer it gave a warning about hard disk erros at first, then rebooted, and then just gave me an out of frequency error right after the BIOS splash screen.
As I did not know what to do and where to look for the root of the problem I eventually set up the system (Ubuntu 11.04) anew, and even completely formatted the partitions for / and /home, so that absolutely everything should have been as it was on day one. But since then, even though the partition for / had actually been deleted and then created anew, instead of the Ubuntu splash screen I continue to get this out of frequency error until the login manager appears. And what's much worse, I get it immediately as soon as I switch to any console with Ctrl + Alt + F2 or any other, so I cannot use any console.
Then yesterday Skype had a crash, and again the whole thing started, after rebooting I only got the out of frequency error, nothing else. So I set the system up again, but the situation is still the same, the out of frequency error up to the login screen remains, and it also remains on the consoles.
There is no problem whatsoever with any system booted from CD. As all actual data had been wiped during the reinstall, I suppose that the problem must be connected with grub 2, some misconfiguration in the boot loader - but I have no idea how to check or change what's there.
The graphics adapter is a GeForce 7025 with nvidia driver 270.41.06. The Ubuntu setup offers two drivers, this is the older one apparently, but it's the same thing with the newer one. The monitor is a PKB Viseo 230Ws at 1920x1080 pixels, H 67 kHz and V 60 Hz.
I am using a 64-bit Slackware 13.1 distro (I chose 64 by mistake, to be honest, as I know there's less trouble with a 32-bit distro) and I have some problems with my consoles (in text mode). After changing the runlevel in ininittab to graphic mode (4), I can't enter any of my consoles. Actually, only ctrl+alt F1 shows some output, regarding the graphic mode (I'm currently using KDE4, the default for slackware 13.1) and F6 is the only normal consoles I have access to. However, if I log out and log in (with another user, maybe) there's no output anywhere (not on F1, neither on F6).
View 1 Replies View RelatedI am tring to run a few game servers on CentOS 5.5, this is a headless server I am renting and I do have root level access and am able to install or run anything.
For me to run a game server I need issue the following command: ./r1q2ded-x86_64 +set dedicated 1 +set ip 69.172.231.46 +set port 27911 +set game lithium +exec server.cfg &
I googled on how to disable the extra virtual consoles... I don't need 6 of them and decide to cut it down to 3 There was no luck with Google so I did this my own and seemed to have done the job...
Code:
rm /etc/event.d/tty4 tty5 tty6
This worked fine, but is there anything else I need to do with
[code]....
I just upgraded to openSuSE 11.4 from 11.1. In 11.1 the contents of the virtual consoles are kept after a logout, so if I login again, I get the same environment as before. In 11.4 the contents are lost. How can I switch on this feature again?
View 9 Replies View RelatedI am neither sure what these are called not if this is the proper place to report the problem, please let me know if there is a better place.The consoles that should ne invoked using CTRL-ATL-F1...Fx are simply not there or cause my OpenSUSE 11.2 64-bit to crash. If I hit a combination like CTRL-ALT-F3 (say), my screen goes completely black (there is absolutely nothing on screen), not only that I cannot return to X (using Gnome, if that makes a difference), none of the CTRL-ALT-Fx work after that and I must do a hardware reset.
View 2 Replies View RelatedI had installed vmware player in my windows 7 OS. How to work on virtual consoles in vmware player were I had installed linux.
View 11 Replies View RelatedI upgraded from 9.04 to 10.04.1 so I am still using legacy grub.Anyway, I noticed with the update that the console is using the framebuffer and using VESA for high resolutions.I really don't like or want this feature. So I added vga=0 to get 80x25 and it works initially but just when the X server is running (Xubuntu in my case) I can see how the console switches to a high resolution again. After this, if I go to a console, lets say tty1, it is using again a high resolution instead of 80x25 (VGA). Is there a way to force the consoles to be in a lower resolution and keep it that way? It used to work fine in ubuntu 8.xx and 9.xx
View 2 Replies View Related