Programming :: Setting Variable At Tcshell
Jul 11, 2011how can i set variable by following Quote: >> ./kuku -u a b c d -n ga go gi how can i set variable at tcshell... Quote: user = a b c d num = ga go gi
View 7 Replieshow can i set variable by following Quote: >> ./kuku -u a b c d -n ga go gi how can i set variable at tcshell... Quote: user = a b c d num = ga go gi
View 7 RepliesI am killing myself with this, please someone come to the rescue...
Code:
#!/bin/sh
IFILE=$@
[code]...
I'm trying to read content of file to variable and use this variable in for loop. The problem is, when I have c++ comment style in file - /*. Spaces in line are also interpreted as separated lines.
For example:
Code:
Changing $files to "$files" eliminate these problems but causes that whole content of variable is treated as one string (one execution of loop).
my script has a variable which comes in the form +00.00 +0.00 -00.00 or -0.00 (the numbers can be any in that form) for any that have a + symbol I need to remove the +, but if it has a - symbol it needs to stay.
i need to make a new variable with the string from the old variable btut without any plus sign. I have tried a lot of different ways with no success, each thing I tried either left the + or removed the entire string. I think this should work but doesn't
foo=+12.40
bar=${foo#+}
how I can search within a variable and assign the results to a new variable. I'll use the following as an example -
cars="Audi BMW Cadillac Chevy Dodge Ferrari Ford Mercedes"
list=`echo ${cars} | egrep -o '<A?+|<C+'`
with the echo command I get the following output assigned to list -
A
C
C
What I'd like to get for output is -
Audi
Cadillac
Chevy
how I could do this regardless of upper/lower case letters?
included shell script inside c program, and i wanted to assign the value of c variable to shell variable..Can any one please suggest me how to do it?
View 8 Replies View Relatedhow to install and use tcshell instead of bash shell...
I run this command but it still dosent work
# yum install tcsh
after installing I use this command to setting it as a default login
$ which csh
but it not work yet...
This loop is part of a bash script which takes multiple arguments.
Code:
for ((i=1;i<=$number;++i)) ; do
offset=$(($i+5))
[code]...
I have problems with setting my JAVA_HOME variable. I am using Slackware 12.0, bash shell. This is a question for the 'Linux Newbie' forum (not slackware-specific).
I have set JAVA_HOME in my /etc/profile, like this:
But when I login in with my user name and type env on the command line, I get for JAVA_HOME the following:
Also, in my /etc/profile I have put the path to my java in the PATH variable, like this:
And when I type env when I login, then the PATH variable contains correctly the path to the jdk (as I have put it into /etc/profile).
I expect that after I have set everything as I want in /etc/profile, and restart the computer then what I have set will be relevant and when I login and type env, I will get values to the variables equal to those I have set in /etc/profile. Why it does not happen?
I have particularly a problem with a Java application, which I want to run. When I type ant, I get:
error: JAVA_HOME is not defined correctly. We cannot execute /usr/lib/java/bin/java.
Whenever i want to start tomcat server I need to go totomcatdir>inand execute startup.sh file.How would i make this happen whenever i start my machine?Also want to know How would i set the variable at startup.
View 10 Replies View RelatedI have been trying to change my PATH environment variable to no avail. I am using Jessie i386 with MATE. Using my .bashrc file works but not well because with subshells the modifications get repeated. I want the change to occur on login.
I tried modifying ~/.profile ~/.bash_profile /etc/profile and /etc/environment and one or two others but in no case did my change get picked up even after logging out and in again and even after rebooting. I searched the Internet and found each of the above places to make the change but they don't seem to work with Jessie.
Where do I make the necessary change?
I am connected to work via a VPN. I am logging into a Solaris box at work from OpenSuse 11, using ssh -X. I would like to start a GUI on the solaris box. The problem is that I don't know what value to give the DISPLAY variable. Is it the local internal LAN ip address, for my machine? I did try that, and I tested it using, xterm on the solaris machine. It says it can't open the display. I have enabled remote connections on my machine using xhost +.I have to run a performance test on the Solaris box at 7am in the morning... so need to find out how to start the GUI
View 6 Replies View RelatedWhat steps have to be followed for having customized contents of PATH environment variable whenever new users are created? I require this in order to include a special directory into PATH variable; and this has to be a default one for all the newly created users.
View 3 Replies View RelatedI installed java in my pc by running the following on the shell
./jdk-6u24-linux-i586.
I need to set the path to the bin directory and also a new environmental variable JAVA_HOME.
I'm trying to define a variable, CHAN, by dividing another variable, FREQ, by a number. FREQ is a value from a file (called header.txt). What I think I'm doing with this bit of code is reading a number from header.txt whose location is specified by the head and tails, assigning it to FREQ and then defining CHAN with bc.
Code:
#!/bin/bash
while read FREQ
[code]....
Since I got the liquorix kernel installed on my machine I got an error of setting kernel variable error. net.ipv6.bindv6only at boot time, since it wasnt a big deal I never looked further into it, but now that I had some spare time and I didnt want to see any errors on my machine I found a solution for it, with a little googling all we need to do is read the /usr/share/doc/procps/README.Debian and bingo no more error i hope this help anyone else with the same problem. I did the 3rd suggestion on that file to load the module in /etc/modules cheers.
View 4 Replies View RelatedI am a newbie to Linux. I tried setting environment variable using export JAVA_HOME=/usr/java/jdk1.6 but that was not permanent (i.e is was there for that terminal session). I want to know how can i set environment variable permanently in Fedora 13 just like we do in windows.After google search, some user suggested to edit bashrc and profile file for setting environment variables but above file contains some shell programs.
View 3 Replies View Relatedi want to pass variable in mysql qyery in c programming
View 1 Replies View RelatedHow to install oracle? I have been tried many times but seems can't resolve the DISPLAY issues.
All installer requirements met.
Use the following command to view the current DISPLAY environment variable setting:
I have beat this enough and don't get what should have been a very simple thing to do. I build a variable;
Code:
CLIST=java,lua,python,php,perl,ruby,tcl
CLIST will be used by another bash script but I need to replace the commas with a space. I
[code]...
How would I go about defining a variable from a document name. Example:document01.doc I want to take the 01 and set X to equal integer 1.
View 1 Replies View RelatedI need to replace JAVA_OPTS= with JAVA_OPTS=<some_value>.I need to give "" value at the end of the replacement. I have tried with the following but it is not working: sed -e "s|JAVA_OPTS= |JAVA_OPTS=<some_value>"
View 2 Replies View RelatedI have been searching most of today and am stuck on getting a variable into an awk portion of my bash script. I have this working:
Code:
#!/bin/sh
SRC=/var/log/mail.log
DEST=/var/www/output/myFile.txt
VAR=userName@myDomain.tld
[code]....
Can awk take a shell variable? Or do I have to do something completely different?
In C++ what does the suffix, "*" mean appended to a variable type, e.g., "char* variable1;"?
View 3 Replies View RelatedFollowing is the way I saw a variable initialized in C
Code:
static const unsigned int rtl8139_rx_config =
RxCfgRcv64K |
(RX_FIFO_THRESH << RxCfgFIFOShift) |
(RX_DMA_BURST << RxCfgDMAShift);
on following link
[URL]
I have initialized variables in past but above initialization I could not understand what is it?
problem statement:
pattern_search="Exam Name"
sed -n "/$pattern_search/,/hello/"p tmp5 | awk '{if ( $4 != 0 && $4 ~ /[0-9]+.*[0-9]*/ ) print "$pattern_search" " " $0 }'
"tmp5" is a file. this is printing output as
$pattern_search value1
i.e value of $pattern_search is not getting substituted. i am expecting output as
Exam Name value1
how shall I print each variable separately using a generalized form. I tried writing the following within a for loop...Code:echo $(echo a$(echo $i)$(echo $j))which did yield no result. So what shall I write??
View 3 Replies View RelatedI have the following input:
Code:
Event 1............................................................
full_name: JENNY_JENNINGS genre: f
age: 32
[code]....
But as you can see in the input, in the 2nd "Event", the line containing "age" is not present, but in the output my code is printing the 1rst age value twice. The correct output should be blank in the age field for 2nd line in the output like this:
Code:
full_name|genre|age|code
JENNY_JENNINGS|f|32|15a
JOHN_JOHNSON|m||23c
MARY_JEAN|f|25|11d
What is wrong in my code? how can I fix it? * I�m using ubuntu 10.10
How are environment variable set in tcl? I tried "set $env(MYVAR) xxxx" but it didn't work.
View 1 Replies View Relatedi'm trying to execute a shell script, i'm trying to use the values in an array for use in a sed command:
sed -n '/Sales ID: ${array[$i]}/,/Totals:/p'
that command creates empty files. so my guess is that its not recognizing the array as an array but as text?
how would i be able to utilize the array in the command? i got it, didnt think that if i doubled up the single quotes that it would work, but this worked:
sed -n '/Sales ID: '${array[$i]'}/,/Totals:/p'