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

>>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.

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

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

Thank you very much Mike fr your suggestions!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.