Hi ,
like to ask if we use ksh script to take in parameter into $1
and how do i concatenate the $1 value with some words into a variable?? Below is what i have written and i think is wrong ,how do i write it?
datafile="Report" || $1 || ".xls" (Should become Report2000.xls)
echo... (3 Replies)
I need a way to build variable in this manner:
variable_$i
Inside a for loop i need to create it.
where i goes from 1 to 30..
and then i need to print them on screen with echo $variable_$i
which is the best way to do this? (6 Replies)
Hi
I need a script which will remove a path from PATH environment variable. For example
$echo PATH
/usr/local/bin:/usr/bin:test/rmve:/usr/games
$echo rmv
test/rmve
Here I need a shell script which will remove rmv path (test/rmve) from PATH... (9 Replies)
Hello All,
How to concatenate a string to a variable in a script
I'm having a file which is consisting of data and i need to extract the first line of the file and append it to a string.
/tmp/samp.list containg 60000
I like to concatenate it with a string (SS_)
grep -w SS_$(head -1... (1 Reply)
Hi,
Could anyone help me in writing a single line code by either using (sed, awk, perl or whatever) to extract a specific path from the PATH environment variable?
for eg: suppose the PATH is being set as follows
PATH=/usr/bin/:/usr/local/bin:/bin:/usr/sbin:/usr/bin/java:/usr/bin/perl3.4
... (2 Replies)
Hello,
It might be stupid question But I will ask it any way:)
var1="1 2 3 4"
var2="5 6 7 8"
var3=$var1\ $var2
var4="$var1\n$var2"
echo "$var1"
echo "$var2"
echo "$var3"
echo "$var4"
The result of executing this code is as follow
1 2 3 4
5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4\n5 6... (12 Replies)
Hello Folks,
I want to append a path in user's PATH variable which should be available in current session.
Background
Numerous persons will run a utility.
Aim is to add the absolute path of the utility the first time it runs so that next runs have the PATH in env & users can directly run... (6 Replies)
Hi I'm trying to select text between two lines, I'm using sed to to this, but I need to pass variables to it. For example
start="BEGIN /home/mavkoup/data"
end="END"
sed -n -e '/${start}/,/${end}/g' doesn't work. I've tried double quotes as well. I think there's a problem with the / in the... (4 Replies)
Hi Guys,
I have a file. Each record needs to inserted into a table. The table also have other columns which needs to be inserted with Shell variables.
The following is the file.
Error code None.
Error Code 1
The shell script is having these variables.
Name=Magesh
Dep=Coding
... (1 Reply)
Hi Guys,
I was scratching my head for this for half a day... finally not successful :confused:
Following is the problem
I have a variable
$ var1=123
$ var2-234
$ var3=345
and another Variable
$ i=1
Now i wanted to save these into a Variable as shown below
for i in 1 2 3
do... (5 Replies)