0

I am trying to create a folder with in a folder by passing a parameter.

this is what I am trying to do

parameter I am passing in a function today(date) is 20080124
and declared a variable
dir=/ab/bc

I want to create a directory with this this parameter value with in directory $dir
so I am saying
pwd=$dir
mkdir=$date
pwd=`$pwd+$mkdir+"\"`

is this valid???please advise

3
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by MONITORING
0

>>is this valid
Probably not. Did you run that to see what it does? You probably need something like this: pwd=$dir + '/' + $date + '/' I assume you are doing *nix shell programming, hence the forward slashes.

0

Thank you very much!!!

one more question,
I am tryign to run mysql from my shell script by passign a parameter.the sql(script.sql) is in directory $mydir and the parameter is $date and trying to run it this way:

un="username"
pd="PASSWORD "
dbname="dbname"


result = `mysql($un,$pd,$dbname,$mydir,"script.sql",$date)`

I am trying to store the date in result.is this valid statement???

Please advise???????
thanks so much

0

Hey There,

If you want to use $pwd more than once, you should change the original pwd= assignment to a different variable name since you reference the original value in the value of the variable of the same name later.

Otherwise, you could also just do:

pwd="${pwd}${mkdir}\"

just a matter of preference

Best wishes :)

, Mike

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.