10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
Discussion started by: danish0909
5 Replies
2. Shell Programming and Scripting
I am experimenting with some scripting as a way to learn more about it. I have a simple script that calls two other scripts. Each script echos some stuff to prove it ran and then sets a simple variable and exports it.
I cannot get one of the variables to display back in the main calling script... (2 Replies)
Discussion started by: scottrif
2 Replies
3. Red Hat
Hi all,
Hereby wish to have your advise for below:
Main concept is
I intend to get current directory of my script file.
This script file will be copied to /etc/init.d.
A string in this copy will be replaced with current directory value.
Below is original script file:
... (6 Replies)
Discussion started by: cielle
6 Replies
4. Shell Programming and Scripting
I have a txt file from which i am assiging a value to a variable
using the code in script1
script1.sh
export f=$(sed -n "/Freq *=/ s/.*= *//p" ${R_path}/output.txt)
echo "$f" --------> this works
in script2 ( which executes the script1)
eval ./script1.sh
if && ; then
echo... (1 Reply)
Discussion started by: shashi792
1 Replies
5. Shell Programming and Scripting
Hi All;
I m working on a script and came across an issue ,to explain it briefly here is the sample code
echo $HOSTNAME|while read IN; do var=`echo $IN|awk -F "-" '{print $2}'`; export var; echo $var; done
now I get the value of $var but when it is out of the while loop
it does not return... (3 Replies)
Discussion started by: maverick_here
3 Replies
6. Shell Programming and Scripting
Even though the idea "might" not be great I still wrote this piece of code to get practice.. Which means that it is the CODE that matters here.
Anyways;
The intension is to create a program(or do we call it script?) that searches recursively through a folder to find a file - stored in a... (4 Replies)
Discussion started by: Pesk
4 Replies
7. Shell Programming and Scripting
Hi all,
I have a variable say var1 (output from somewhere, which I can't change)which store something like this:
echo $var1
name=fred
age=25
address="123 abc"
password=pass1234
how can I make the variable $name, $age, $address and $password contain the info?
I mean do this in a... (1 Reply)
Discussion started by: freddy1228
1 Replies
8. Shell Programming and Scripting
I want to instert Category:XXXXX into the 2. line
something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong:
sed "2i\\${n}Category:$cat\n"
Sample:
Titel Blahh Blahh abllk sdhsd sjdhf
Blahh Blah Blahh
Blahh
Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies
9. Solaris
Hi,
can anyone tell me the difference between the below two examples:
Eg-1:
# name=bravo
# echo $bravo
what would be the o/p
Eg-2:
# name1=jhonny
# export name1
# echo $name1
what would be the o/p
If the o/p's of both examples are the same then what is the use of the cmd export... (3 Replies)
Discussion started by: rahul_11d
3 Replies
10. Shell Programming and Scripting
Hi,
I am exporting the environment variable from config file, but when I echo the variable it does not display any value. Here is the snippet of the code
#!/bin/sh
export ENVIRONMENT_ROOT_DIRECTORY="/cb/$ENVIRONMENT"
echo $ENVIRONMENT_ROOT_DIRECTORY
${JAVA_HOME}/bin/java... (2 Replies)
Discussion started by: bhavnabakshi
2 Replies