General :: Create Aliases With Echoing Text Into The Variable?

Apr 29, 2011

For example if you want to create an alias in Linux with a message echoed into the variable would the following command be; alias hello="(echo)"Hello." "? I'm trying to learn some environment variables and aliases.

View 4 Replies


ADVERTISEMENT

Ubuntu :: Echoing Stuff Like $databas / But As Word Not Variable?

May 26, 2011

How would i go about echoing stuff like $database, but as the word, not the variable?for example:$l = "$database = $db" where $database is supposed to be the word, while $db is the variable

View 9 Replies View Related

General :: Create An Environment Variable With The PRINTER Variable?

Apr 16, 2011

I am supposed to create an environment variable with the PRINTER variable, which should resolve to the word sales. Would the command be like this?: env PRINTER - NAME=SALES (is this the command to create that variable with resolving the word sales to it?)

View 3 Replies View Related

Software :: Get Variable From Text File Into Bash Variable?

Jun 10, 2009

I have a text file i that has a mailTo: NAME in it. In a bash script i need to extract NAME and put it in a $variable to use. How do i do this?

View 2 Replies View Related

General :: Underlined Text In PS1 Variable ?

Apr 11, 2010

I want to underline my user & hostname in the PS1 variable, but I cant seem to do it.

I know that my Xterm can underline text normally, because when I pass Xterm the '+nul' option, then do this:

Code:

It underlines. I just cant seem to get it to work for my PS1 variable, although its quite possible Im doing it incorrectly. has anyone managed to do this, is it possible?

Here is my PS1 variable:

Code:

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

Server :: Create New /etc/aliases For Postfix?

Jun 2, 2011

I have /var on it's own partition. Should i direct mail, in /etc/alises, sent to root to my normal local user or will /var end up getting filled up with mail, if i do that?Also:I went on the forums for dynDNS.com, explaining that i was setting up a network that includes a web server and a mail server. They rightly pointed out that i only needed to set up a DNS A record for webserver.dyndns.org. The mail server would be located by this DNS A record, as both machines share the same external I.P address(the external I.P of my ADSL router). So my mail addresses could be me@webserver.dyndns.org. So both machines would be reachable with the same DNS A record, and port-forwarding on my ADSL router would determine which host got which requests. That's what they said i should do for my scenario.
Bearing this in mind what should the values of $myhostname, $mydomain, $mydestination and $myorigin be?

My current thoughts, on the simplest way to do this, are:If $myhostname is mailserver.webserver.dyndns.org, then $myorigin can be webserver.dyndns.org, then $mydomain is webserver.dyndns.org and $mydestination has it's DEFAULT setting(mydestination = $myhostname localhost.$mydomain localhost).This the simplest workable approach right?, if not what are the best values for these parameters?.Also I have /var on it's own partition. Should i direct mail, in /etc/alises, sent to root to my normal local user or will /var end up getting filled up with mail, if i do that?

View 1 Replies View Related

Ubuntu :: Create Some Aliases For Bash Shell?

Jun 14, 2010

I would like to create some aliases for bash shell. On other Unix/Linux machines I have done this using the alias command like this: alias rm rm -i

When I type that into a terminal on Ubuntu, it looks like alias is not installed. I get this:

bash: alias: rm: not found
bash: alias: rm: not found
bash: alias: -i: not found

I tried adding the alias to .bashrc instead, but then I get the same error message every time I start terminal. Just for fun I tried apt-get install alias, just to see what would happen, and it installed something called libperl-alias instead, and alias still doesn't work.

View 2 Replies View Related

Ubuntu Servers :: How Can I Create E-mail Aliases

Feb 16, 2011

I installed postfix on my ubuntu server.I have created some users.How can I create e-mail aliases?For example, I have a user named "light" and I want to create for him an e-mail address.

View 3 Replies View Related

General :: Text Manipulation Find / Replace Variable Efficiency?

Aug 27, 2010

What I have works, but wondering what is the 'right' way to replace the digits with the letters given in this loop? somehow use a case or multiple sed? i thought of a multiple sed or a case but couldn't get it to work

Code:

# ...
bcv=$(echo $line | awk -F" " '{ print $1 }' | sed 's/1/q/g;s/2/w/g;s/3/e/g') # and so on

Code:

while read line
do
bcv=$(echo $line | awk -F" " '{ print $1 }')
if [ $bcv == "" ]

[code].....

View 12 Replies View Related

Software :: Create Aliases And Virtual Table In Postfix?

May 26, 2010

I'm using rhel5 i configured postfix on it. need is to create virtual table and virtual.db. How can i create these

View 1 Replies View Related

General :: Sed/awk/grep Search For Number String Of Variable Length In Text File?

Jan 19, 2010

I need to search a text file for a string of numbers which are different lengths, and always are between number=" and " like:

number="1234567890"
number="22390"

I need to grab those numbers and pipe each one to a line in a file. I've already tried something with awk and that didn't seem to work.

View 10 Replies View Related

Software :: Aliases - Using /etc/aliases - Does Not Get Routed To My Email

Apr 1, 2009

I am able to send a mail message to myself from a server without any problem...

But after I have updated /etc/aliases and added the line for all of root's mail to be routed to me....

Added:
root: myemail@company.com

and ran newaliases to implement it....

If I send a mail message to root, it does not get routed to my email...

View 3 Replies View Related

General :: Create A Single Line Of Output From Multiple Variable Lines Of Input

Feb 3, 2010

I need to create a single line of output from multiple and variable lines of input in a Linux bash shell script.

My input file looks like this:

Where there may be any number of umsecondaryphonenumber lines; if there is not a umsecondaryphonenumber line for a telephonenumber, I don't want to write any output.

So, the output file should look like:

The script I have so far is:

My question is - how do print each of the elements of an array in one record - i.e. what do I put in place of howdoiprintarray?

View 2 Replies View Related

General :: Create Pdf From Text Files

May 18, 2011

Can anyone point me to a well working peace of software (free will be preferred) that can convert text-files into pdf.

View 6 Replies View Related

General :: Create Folder Name From The Text File?

Jun 23, 2010

1. I need guide on how to create a folder name from the text file with .txt format.

2. First, I call the function of reading the directory.

3. Then, I dont know how to do.

4. Finally, I close the directory

This is my source code in perl

## read text.txt file ##
open F, "from/$directory/text.txt";
read F, $buf, 9999;
close F;[/size]

This source code is used to print the folder with date format like "ddmm" d stands for day and m stands for month

if ($command =~ s/-O "(.*)"/-O "$websites/$month/$file"/)

Instead, I want to have the name from text.txt to be folder name

View 4 Replies View Related

General :: Ubuntu 10.10 - Create A Text Shortcut?

May 12, 2011

create a shortcut to my email, so when im loggin in on different homepages,i can just press ex ALT+F1 and my email will be written in the selected area..

View 4 Replies View Related

General :: Create A Command In The Vim That Saves A Text Document And Also Compile It?

Feb 27, 2011

I would like to create a command in the vim that saves a text document and also compile it. Is it possible?

View 4 Replies View Related

Programming :: Bash - To Prepend Text To Variable

Feb 13, 2010

The output of following code is not like it's intended ...

Code:

This is the output:

Code:

Test prepending ...apple is a nice word, hour is a nice word, But of course what I want to do in the first set of commands is to prepend the word "an" to the words "apple" and "hour" in the for-loop.

View 4 Replies View Related

Programming :: Variable Which Points To The Last Term Of A Text Line?

Jan 5, 2011

I want to get the last term of an unknown-sized text line, by usig the awk command. Is there any variable which points to the last term of a text line ? (obviously, y can obtain that term if i knew how many terms does the line have... i.e. awk '{print $12}' ; if we are talking about a 12-terms text line) I wonder if there is an option like $?, to get the last term.

View 2 Replies View Related

Programming :: Sed Script - Searching For Text Within File / Replace With Variable

Feb 25, 2011

Code:
#!/bin/bash
VARR=`cat /proc/asound/cards | grep HDMI | cut -c 1-2`
VARX="defaults.ctl.card $VARR"
VARY="defaults.pcm.card $VARR"
FILE1="alsa"
FILE2="alsa.new"
echo $VARX
echo $VARY
sed "s/defaults.ctl.card*/'$VARX'/g" $FILE1 > $FILE2

This is what I have right now. Well, I thought I knew sed, and apparently I don't... I tried writing this for someone else, and this has given me trouble, so since the user pretty much figured it out on his own, here it goes.
Say VARR=1, so VARX and VARY contain the above text, appended by 1.
What I am trying to do is replace the text "defaults.ctl.card 0" by VARX and "defaults.pcm.card 0" by VARY. The contents of FILE1 is the file being used to search for both text fields, and FILE2 is the output file. I tried using single quotes, double quotes, and a mixture of both, and no go whatsoever. So my question... What is the proper way of searching for text within a file and replacing with a variable?

View 5 Replies View Related

Programming :: Parse Multiple Variable From Text File With Bash?

Jul 13, 2010

I am trying to think of a logic where my file contains some data I had to read and do some processing. Issue is that file contains data multiple times. For example:

:::::::::::
var1=value1
var2=value2

[code].....

I have to read first paragraph of variables and do some processing and then move on until the end of file. Variable names are same in whole file but for each paragraph the value is different. I can't think of a logic to attain this task. How can I do it? It should be a simple bash script, but I am not able to work out.

View 2 Replies View Related

General :: Assign Local Variable Values To Global Variable?

Feb 17, 2011

how to assign a local variable value to a global variable....

View 2 Replies View Related

Ubuntu :: Cloning Or Echoing Files And Folders

Jan 27, 2010

I need to backup my data through the cloning or echoing option, which means I want to have my new files/folders in the left copied to the right, replacing older files if that's the case, but I also need the deleted files and folders on the left to be deleted on the right.

I'm using Conduit right now, but it doesn't clone folders/files, also tried Synchrorep but the same issue. Should I try Unison or Rsync? Will they offer this option? Other options?

View 3 Replies View Related

Ubuntu Installation :: Echoing To Grub2 Boot Menu ?

Jan 29, 2011

I'd like have some text written on my grub2 boot menu.

In legacy grub you could just add: title Foobar and you'd get "Foobar" displayed.

I tried: menuitem "Foobar" {} grub2, but it doesn't work. Any ideas how do you do something like that?

(Yes, I know writing grub.cfg by hand is not very smart. But I have a special situation: I wrote my own grub.cfg on a dedicated boot partition from where I chainload to other grub on other partitions. Those secondary grubs generate their grub.cfgs on the fly, so everything is OK )

View 3 Replies View Related

Programming :: Echoing A Command Line Within A Bash Script?

Jul 8, 2011

Bash 3.1.7

Suppose this bash script:

Code:
#!/bin/bash
ls foo

I would like the output to be

Code:
ls foo
foo

That is, the command is first echoed then executed. Is it possible to do this? Or is the only way to debug the script?

View 2 Replies View Related

Server :: Script Query - Create A Folder With An Environment Variable?

May 18, 2010

I am busy learning shell scripting, and I managed to get my first few right, but now I am trying to do something that I know how to do in Windows, but not in Linux. Basically, during a file copy, I want to create a new date for each folder on a daily basis to copy backups into.so, in windows the syntax would be "xcopy %systemroot%ackupslah.blah \servernameackups\%date%"in linux I am running a "cp blah.gz /mount/blah" I want to create a folder with the date based on the current date.anyone know how to get the same right in shell script?

View 10 Replies View Related

Programming :: Create A Global Struct Variable With Predefined Member Values?

May 26, 2010

Is it possible to create a global struct variable with predefined member values?Only one instance of that struct is ever needed.

View 1 Replies View Related

General :: Find Where Aliases Are Located?

Aug 5, 2011

Below are few of my questions that i am worried about.

1. alias command will list me all aliases. How to find where these aliases are located?

2. Please suggest me few resources on XWindows

View 5 Replies View Related

General :: Bash Aliases Lost Within Tmux

Jul 8, 2011

I just noticed that my .bashrc aliases (eg. alias www='cd ~/data/public_html') don't work from within tmux. They work fine from screen, though.

I don't think I've got anything special in ~/tmux.conf

Code:
# C-a just like in screen
unbind C-b
set -g prefix C-a

[Code].....

View 3 Replies View Related







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