General :: Evaluation Of Postfix String Using Bash Shell

Mar 15, 2011

I would like to evaluate a postfix string using bash shell script,but I do not know how to start.

View 1 Replies


ADVERTISEMENT

General :: Substring Of String In Tag + Shell Script?

Feb 4, 2010

I have a string variable

var1=<default>111</default>

I want the value between default tags 111 in this case.

I treid to use ${var1:10:3}

But the execution gived "bad substitution' error. If the tags are removed and substring is fetched it works fine. Is there any other was to get substring in a string with tags.

View 5 Replies View Related

General :: Get Part Of A String In Bash ?

Mar 10, 2011

I've a string "this.is.a.name", and I would like to return "is.a.name". How can I do that in bash?

View 3 Replies View Related

General :: Get The Shortest String In A Text File With Shell?

Apr 29, 2010

Assume I have a text file as belowabcdaaaaaaagfgkhahahahahahhahhgfThen gf would be returned

View 4 Replies View Related

General :: Randomize The Comma Separated String In Shell?

Oct 10, 2010

I wanted to randomize the comma separated string.String like "test1,test34,test5,test6".And it would be displayed differently when I ran each time.

Expected output like "test5,test6,test1,test34".

View 13 Replies View Related

General :: Parse String In Bash Script?

Nov 8, 2009

I have to create a bash script that takes an arbitrary length number from the command line, and add up each individual digit

Ex:
server> myscript.sh 123
server> 1 + 2 + 3 = 6

The problem I'm having is pulling out each character.

Is there a way in bash I can parse the input string for each character? I can't figure out a way to do this.

View 4 Replies View Related

General :: Return Part Of A String In Bash?

Mar 20, 2011

I would like to return the last part of a string in an array of strings in bash.

The array contains in each position the content below:

Code:
a.b.c
a.d.f
a
a.d

[Code].....

View 5 Replies View Related

General :: Split A String Into Array In Bash?

Mar 17, 2011

how do I split a string into an array?In this string:"this is a story"how do I split it by the space?

View 8 Replies View Related

General :: Grep Fails In Shell Script When String Not Found / Why Is So?

May 3, 2011

I am having trouble using grep command. I want to search for each line in first file in second file and if they are present, write to file called successfile else to failfile. Below is the code

what is happening is, when the first failure occurs (when a line in first file is not present in second file), the script is killed.

Can anyone please tell me what I am doing wrong? code...

View 4 Replies View Related

General :: Environmental Variable In Bash Command String?

Feb 9, 2011

I do this:

Code:

a@b:~$ export A=hi
a@b:~$ echo $A
hi
a@b:~$ bash -c "export A=blah; echo $A"
hi
a@b:~$

Why doesn't the bash command print the new value of $A? Is there a way to make it do so?

View 6 Replies View Related

General :: Change Case Of A String (BASH Scripting)?

Jul 9, 2010

Is there any inbuilt functionality in Unix shell script so that i can able to convert lower case string input to an upper case? I dont want to use high level languages like java,python or perl for doing the job.

View 4 Replies View Related

General :: Pull String From A File Into A Variable Using Bash

Aug 6, 2011

I have a file (.tmpfile) and inside it is a string which i only know part of, the rest being a random group of characters... I would like to know how to pull the whole string out of the file and into a variable.

View 13 Replies View Related

General :: Check If Any Of The Parameters To A Bash Script Match A String?

Sep 8, 2010

I'm trying to write a script where I want to check if any of the parameters passed to a bash script match a string. The way I have it setup right now is if [ "$3" != "-disCopperBld" -a "$4" != "-disCopperBld" -a "$5" != "-disCopperBld" -a "$6" != "-disCopperBld"]but there might be a large number of parameters, so I was wondering if there is a better way to do this?EDIT:I tried this chunk of code out, and called the script with the option, -disableVenusBld, but it still prints out "Starting build". Am I doing something wrong?

while [ $# -ne 0 ]
do
arg="$1"

[code]....

View 3 Replies View Related

General :: Bash: Substitute Parameter In A Quoted String - Stored In Another Variable

Jan 31, 2010

(variable substitution?)
(parameter expansion?)
Code:
run_repeatedly()
{
NUM=0
while [ <irrelevant stuff here> ]
[Code]....

run_repeatedly "programX -o "./messy/path/output-$NUM.txt"" The echo inside the loop prints "...-$NUM.txt"; obviously I'm aiming to have bash substitute the iteration number so that I end up with many output files not 1.

View 5 Replies View Related

General :: Split A String Into Array In Bash Return Wrong Size?

Mar 21, 2011

I'm trying to split a string, to later iterate using a for loop like

Code:
for (( i=0; i<5; i++))

But, my script returns an array with the size 1.

Here's the script:

Code:
aver=$(grep "avg" A.txt | awk '{ print $2 }');
a=$(echo $aver | tr " " "
");

[Code]....

View 2 Replies View Related

General :: Can Use Redhat Enterprise After 30 Days Evaluation ?

Jul 5, 2010

Actually i want to know if i don't want any support or software update from redhat, can i continue to use RHEL after 30 days evaluation ?

View 3 Replies View Related

General :: Evaluation Mails To Windows Outlook

Jan 21, 2011

i wanna convert my evaluation mails to windows outlook.

View 1 Replies View Related

General :: Install A Different Flavor To A Second Hard Drive For Evaluation?

Feb 27, 2010

I have just moved from Windows Vista to Ubuntu about a week ago. Ubuntu is on my old c:drive...no windows at all. Can I install a different flavor of linux such as Fedora, Mandriva, etc to a separate external hard drive so the I can evaluate different ones?

View 3 Replies View Related

Fedora :: Stuck With Bash Shell / Changing Default Shell To Tcsh?

Mar 14, 2010

I want to change my default shell to tcsh. I used

Code:
usermod -s /bin/tcsh username
command as given at url

But if I open a new shell, it is still a bash shell.

How do I make my default shell as tcsh?

View 6 Replies View Related

General :: How To Use Foreach In Bash Shell

Mar 25, 2010

I used c-shell previously in unix. One of the useful command I used frequently is foreach.> foreach a (`cat list`)>> echo $a need to use bash shell now instead, and realized that I can't use foreach anymore. The command is not found. Does anyone knows if there is similar command / function in bash shell?

View 9 Replies View Related

General :: Use Bash Shell When I Run A Program From It?

May 11, 2011

So I open firefox from my bash shell with:

Code:
firefox google.ca
it opens firefox, I can browse, etc.
Now if I alt-tab back into my shell, i can't enter any commands in the shell.

I know that i can do this if I close firefox, but I want to keep working in my shell with firefox still open.

Is this possible?

View 6 Replies View Related

General :: How To Unlimited Bash/shell History

May 4, 2010

Is there a way to define an unlimited history in Bash ?

View 3 Replies View Related

General :: Get Bash History From Another Shell Instance

Aug 18, 2010

Possible Duplicate: Can history files be unified in bash? I have bash running in an ssh session, call this session A. I leave the office, go home, ssh to the same box, call this session B. From session B, I'd like to be able to look at the history of session A.

View 1 Replies View Related

General :: How To Get Bash Shell History Range

Oct 4, 2010

How can I get/filter history entries in a specific range?I have a large history file and frequently usehistory | grep somecommandNow, my memory is pretty bad and I also want to see what else I did around the time I entered the command.For now I do this:get match, say 4992 somecommand, then I do history | grep 49[0-9][0-9]this is usually good enough, but I would much rather do it more precisely, that is see commands from 4972 to 5012, that is 20 commands before and 20 after. I am wondering if there is an easier way? I suspect, a custom script is in order, but perhaps someone else has done something similar before.

View 2 Replies View Related

General :: How To Minimize Bash Shell Prompt

Oct 26, 2010

Currently the terminal prompt looks like this:[karlis@karlis-desktop current_folder]$How can I minimize the prompt, so that it only shows $ or # without extra info in square brackets?I checked the preferences for the default Gnome-Terminal and Terminator - there are no settings for this. It is pretty hard to use terminal when working in directories with long names.

View 1 Replies View Related

General :: Bash Shell Script With Menu?

Apr 12, 2011

I've written a bash shell script (code provided below) that gives the user 4 options. However I'm having a little trouble with the code. Right now when they select option 3, to show the date.It loops over and over again.I have to close the terminal window to stop it because it's an infinite loop. How would I prevent this? Also quit doesn't seem to be working either.

#!/bin/bashe
echo -n "Name please? "
read name
echo "Menu for $name[code]............

View 2 Replies View Related

General :: Bash - Get ' Quote ` Back-tic Through The Shell Into Sed?

Aug 3, 2011

In linux how do I to get the ascii decimal/hex/oct code from a char or a ascii char from a decimal/hex/oct code. I see from the gnu sed user manual that I can use the d# o# x# to specify a character but I am not sure how to use that. If some one has a better way to get the the ` and ' chars through I want to sed with the backtick '`' character and ''' single quote character.

sed '/`/p'

these don't work

sed '/'/p'
sed '/`/p'

View 3 Replies View Related

General :: Bash Shell Scripting Request?

Feb 27, 2011

I am working on a simple script that should take two command line arguments, a [number] and a [name]. The first thing the script should do is check to make sure that no more and no less than two command line arguments have been entered when calling the script - an error message should be delivered if the condition is not true.

If two args have been entered, then the message 'processing "scriptname"' should appear, where scriptname is the name of the script being called. The script should then write to the screen "Hi [name]!", and should write this phrase [number] of times. For example, the command $ myscript 2 joe would produce the output: I have read the manual many times looking for examples, and I am very close by virtue of my own efforts. Further, I have searched these forums and others for good examples, which have also gotten me very close. Still my script is not completing the objective, and I am wondering if someone could point me in the right direction. Script:

[Code]...

View 13 Replies View Related

General :: How To Handle Character In Bash Shell

Apr 30, 2011

i have a script where i need to pass an argument "1234:-)"if i run this as ./shell.sh 1234:-)it wont work because invalid character. i need to handle this with expect utility so if i pass it as ./shell.sh "1234:-)"no issue in bash but expect does not recognize this.

View 7 Replies View Related

General :: Using Bash Shell Script Inside Php?

Dec 30, 2010

how do i use bash shell scripts inside php.I am just trying to call a simple cp command using php. Its not doing anything.

View 2 Replies View Related







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