General :: Put Custom Text On Terminal (bash Script)?

Jan 19, 2010

This code:

Code:
#! /bin/bash
echo Okay.
echo
Does not do it....

P.S. I want to show my parents what happens when I do:

Code:
sudo make me a sandwich
and have it say "Okay."

View 11 Replies


ADVERTISEMENT

General :: Select Text In BASH Terminal Using The Keyboard Without Mouse?

Jan 2, 2011

How to select text in BASH terminal using the keyboard without mouse? I'm using Ubuntu 10.10

View 1 Replies View Related

Ubuntu :: Creating A Text File To Start Up Sudo Bash Without Going To The Terminal?

Feb 26, 2011

I just set up apache on my PC and I cant change the permissions by right clicking because "I'm not the owner" and instead of using the chmod command on every file that I would like to edit I would just like to write a script on a text file, save it to my desktop so all I have to do is double click on it and boom I can edit all my files, etc.

View 2 Replies View Related

General :: Bash - Where And How Are Custom Startup Commands Configured

Jan 11, 2011

I'd like to add custom startup commands (for example starting a process, registering to a registration server, downloading a configuration file) to the Linux startup process. Those commands should be triggered on startup only. What is the standard/appropriate way to do this?

EDIT: Is /etc/profile the right place to trigger such things?

EDIT2: I'm using Ubuntu.

View 4 Replies View Related

General :: Custom Syntax Highlighting In Bash Shell - Using Keywords

Apr 25, 2011

I know it's possible to change the $ user@hostname colors, but is it possible to color different things? Could I make all numbers/integers a certain color. Or set certain keywords to be bold?

View 1 Replies View Related

General :: Getting Terminal Emulator With Custom Scripts And Hotkey Support?

Oct 16, 2010

I need a terminal application for linux with support for custom scripts and support to bind this scripts for hotkeys.For example I login into computers hundreds times a day. I don't want to write login and password, but to press a hotkey (Ctrl + Z for example) to automate this process. [input login, press Enter, input password, press enter, input some command...]

View 2 Replies View Related

General :: Create Custom Terminal Boot Mode Under Ubuntu?

Aug 5, 2011

I wonder if it would be possible to create a custom boot menu entry in grub under Ubuntu (11.04), that boots the system into terminal instead of the login screen.

The effect should be something like the root shell in (rescue mode) boot menu entry, one that gives me access to a root shell or a less privileged shell, without the need to select "root shell" explicitly.

If possible, I also would like to customize the shell started by, most preferably by specifying a shell script to run so that I can start something other than bash, like vim.

My intention is to create a "fast" boot mode to give me a usable system within seconds (to take notes, for instance) without needing to start GUI. Therefore, it is preferred that the silent option is turned on.

Note: There is a requirement: that no existing feature of the system is removed. That is to say, the gnome desktop (and Unity) should remain intact, and is only disabled when I choose this mode.

View 2 Replies View Related

Programming :: Bash Text To Variable Accessing Individual Text Lines?

May 2, 2010

i 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

View 11 Replies View Related

General :: Echo Text With New Line In Bash?

Jun 21, 2010

I would like to append text to a file. so i wrote in bashecho text >> file.confHowever it doesnt leave a new line. So i can only do this once. How do i add a new line?

View 2 Replies View Related

General :: Bash - Search For A Text Pattern?

Nov 28, 2010

I need to search for a string "teststring" in all *.java files coming under /home/user1/ (including subfolders). How can I do it in linux via shell command.

View 5 Replies View Related

General :: Adding Text To End Of Particular Line In Bash

Nov 30, 2010

I am looking at how to add particular text to a file in bash.Here is what I am trying to do:In the /etc/grub.conf file, I am trying to add "audit=1" (without the quotes) to the end of the kernel line...such as:kernel /vmlinuz-2.6.18-194.el5 ro root=LABEL=/1 rhgb quiet audit=1

As there are a few different lines in this file, I am only looking to add the "audit=1" to the above line via a bash script.

View 7 Replies View Related

General :: Bash - Add Text At The Beginning Of A Line

Feb 28, 2011

I have a lot a folders, each named by a number, and in each of these folders I have a specific file (stddev.dat) containing a single line (of numbers) I need to have a single file with each line being one of the stddev.dat (no matter if it is sorted or not), and also I need to add at the begining of each line the number of the folder it comes from.

I 'm no bash expert, and the "add at the begining of the line" is a bit of problem to me". Here is what I've come up with so far, just to put everything in one file, (and also if you know a better/more elegant way to do the same thing I've done, I'm listening)

[Code]...

View 6 Replies View Related

General :: Getting Text In The Terminal Window?

Sep 15, 2010

I'm writting a BASH script for a solaris system and need to have text enter into a console window. I've got so far:

#!/bin/bash
xterm
echo "text goes here"

When I run it I get the terminal window but the text going into another window. Nothing that I've found on this site helps me so far. If this is the wrong board, I'm sorry but I figured I'm about as newbie as it gets.

View 2 Replies View Related

General :: Bash - Using Terminal Vs KDE?

Mar 18, 2010

Im used to using nautilus within centos but have recently just got a VPS and quickly realising that using a KDE is unacceptable in this environment. Although I do find it so much quicker doing things like folder permissions in KDE rather than typing it all out in the terminal? Everyone I speak to says, use the terminal and I should learn this way as opposed to using the KDE, but theres certain things I just dont get

How is it possible to make quick changes to scripts and viewing them in a browser etc , without a mouse or using KDE? and only using a terminal?? I am wondering how to develop websites just using the terminal?

How can it be quicker to type out/view permissions etc in the terminal when its instant and just a few clicks in the KDE?

View 3 Replies View Related

General :: OpenSuse Terminal Text Editor

Mar 26, 2010

please let me know what are the commands I have to use & how to save a "OpenSuse Terminal text editor" once we have updated the file.

View 8 Replies View Related

General :: Setting Default Application For Text Files In Bash?

Apr 5, 2011

I want to tweak my linux environment so that when I type a text file name on the command line and hit enter the file should be opened in Vim.

$: /tmp/file.txt

should open the file in Vim. This is similar to what happens on windows (where a text file is opened in notepad.)

View 6 Replies View Related

General :: Bash Shell Syntax For Opening A Text Editor?

Apr 28, 2011

I'm trying to be able to Open a text editor without needing an existing file.This is my code:

case $ans in
"Show Today") echo "$(date)";;
"Show Calendar") cal;;

[code]...

View 14 Replies View Related

General :: Write A Bash Script To Parse A Text File?

Apr 27, 2011

I want to write a bash script to parse a text file with the following lines and set variables for each line so that I can use them in the rest of the script.

Timestamp=123456789
Company=ABC Company
Server=Server
Recipient=Joe Smith
Email=joe@abc.com

simplest way to read each line one at a time for everything before the =, set that to a variable name with the value equal to everything after the =

View 14 Replies View Related

General :: Copy And Paste Text Among Documents In Terminal

Mar 28, 2010

What is the best way to copy and paste some text among text documents in Linux terminal environment? Suppose I have 2 documents, A and B, and I want to copy some part of A to B. What is the way to achieve this?

View 5 Replies View Related

General :: How To 'find' Text Listed On Terminal Screen?

Dec 21, 2010

Since I see on my Centos 5 system, when using the Gnome Terminal, there is no 'Find' feature, do I use grep to search the output on Gnome Terminal?

I see grep syntax is:grep search-term file

But what do I use as the 'file' when what I want to search is the contents of the gnome terminal screen?If there is a good terminal program that does have a 'find' feature, let me know.

View 2 Replies View Related

General :: How To Specify Text Message Color On Gnome Terminal

Aug 11, 2010

OS is CentOS 5.5, and GNOME terminal emulator (v2.16.0). However I regard the question is not related with OS/Gnome version level. My question is whether if color setting is available or not for the text character outputted by kernel (or shell, i.e. Bash). Normally we can specify/modify text character color (and background color) with property setting on the terminal. However, it only takes affect to the text for inputting character, not for outputted character by kernel/shell. For example, when we type a shell command "ls -al <cr>", the text appears with the color along with the terminal property.

Meanwhile, the text message displayed on the console (output message against "ls -al" command), in this case it must be file and/or directory names, will appear with some preset color which we've not preliminarily set. In my case, I set Text color with "White", Background color with "Black". Then I expect the text output message color displayed by kernel/shell would be some brighter color. But the color is "blue" which does not look better brightness against "Black" background. For this situation what I'd like to know is how to set/specify the color outputted by the kernel/shell (or whether or not it is possible to set manually).

View 4 Replies View Related

General :: Opening Files In Text Editor From The Terminal

Mar 7, 2010

Using ubuntu 9.10

If I'm in a terminal window, and I open a file by typing eg :

It opens as a blank document... I know it has text in it though!

I've tried with other files and also with nano so it's not just a problem with a particular file.

How do I view the current contents of the file so I can then edit it?

View 4 Replies View Related

General :: Read A Text File And Ftp Files Using Bash W/out Leaving The Ftp Prompt

Oct 9, 2009

I have a script almost working except for 1 thing. What I'm trying to do is read a file that has the files that need to be FTP'd using a bash script. I have everything working except the reading of the file. It works outside of the ftp script I've wrote but once I put it in the FTP script it doesn't.

Here's the Script:

#Here's where the problem is that I know of

I've been playing w/ the exclamation points to see if that could be the problem, but so far no luck.

View 6 Replies View Related

General :: Write A Bash Script That Will Read The Word From The Text File?

Jun 10, 2011

I have a text file that contains a single word and I want to write a bash script that will read the word from the text file... The following is my incorrect attempt, as it assigns the name of the textfile to the variable as opposed to the word stored within the textfile:(assume I have a text file value.txt that has its contents a single word, say wordone)

Code:
#!/bin/sh
for f in value.txt
do
echo $f
done

so the output of the above script is value.txt, however I want it to be wordone.to summarise: how do I assign the value of the word contained within a textfile to a variable?

View 1 Replies View Related

General :: Bash - Detect When A Terminal Gets Focus?

Jun 23, 2011

I want to be able to time how long I spend in front of a terminal. I'm thinking the best way will be to have some sort of timer that starts and stops when the terminal gains/loses focus. And it will have to work with multiple terminals...

I'm using GNOME.

View 3 Replies View Related

General :: [Bash] Send Command To Another Terminal?

Sep 10, 2010

I open up 2 xterms on my desktop, A(/dev/pts/0) and B(/dev/pts/1).I can write from A to B using redirection e.g. echo "test" > /dev/pts/1How do I run a command from A on B? e.g. "clear"Basically I'm putting the 2 terminals side by side, and using terminal B to display the contents of the current working directory, by running the following in A:export PROMPT_COMMAND="ls -a > /dev/pts/1"but this fills up the screen pretty fast. I was actually looking for a way to clear up the second terminal.

View 6 Replies View Related

General :: Copy Text From Xterm Based Terminal To Some Other Gui Application?

Jan 13, 2011

i use uxrvt ( for those who dont know, its terminal emulator based on xterm).i know its easy to copy/paste stuff from terminal to itself is a trivial thing. it can be done by mouse left click to select and middle click to paste.but in my case i need to copy text from terminal to another application, viz on google chromium.

View 1 Replies View Related

General :: Mac Terminal - Remove Text Prefixing Dollar Sign

Mar 27, 2011

how to remove the text prefixing the dollar sign in mac terminal?

For example,

Peters-MacBook-Pro:~ peter$ ls my_dir

should become

$ ls my_dir

View 2 Replies View Related

General :: Changing Font Size In Text Mode Terminal?

Apr 10, 2011

I have a ubuntu linux working in TEXT mode. I would like the change the font size (or if possible, get my terminal with inconsolata font). How can i do it?

PS: i don't have a GUI or X Windows running.

sudo dpkg-reconfigure console-setup

View 1 Replies View Related

General :: Convert A Text File From Shift JIS To UTF-8 And Back From The Terminal?

Jul 21, 2011

In order to make this conversion I have to use a text editor. This is tedious. Is there an easier way to do it, like some program I can run from the Linux or OSX terminal?

View 1 Replies View Related







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