How to cut, concatenate data in Shell Script

Hello All,,
I'm very new to Unix and I'm more in SAP ABAP. I have a requirement for a shell script which will accept one parameter as Input file name(with directory)
e.g : /sapdata/deubank/dbdirect/out/deu01deupe/in/deu01deupe20051207111320.pmt

In the shell script I have to make two more parameters as
a> outfile = /sapdata/deubank/dbdirect/out/deu01deupe/out/deu01deupe20051207111320.pmt
and
b>chkfile = /sapdata/deubank/dbdirect/out/deu01deupe/chk/chkdeu01deupe20051207111320.pmt

I request experts to help me make this file.... Another problem is I don't have any starter help in unix to start with.

Thankx in advance.
Regds.
Srivas.

Here is a script that will do what you require.

But, the logic in it is based on the data you have provided.

[@~/temp]$ cat vasan.ksh 
#! /bin/ksh
[[ $# -eq 0 ]] && echo " Need an input" && exit 1
FILE="$@"
[[ -f $FILE ]] && echo "$FILE not available" && exit 1

# FILE could look like
# FILE="/sapdata/deubank/dbdirect/out/deu01deupe/in/deu01deupe20051207111320.pmt"

# ROOT_DIR="/sapdata/deubank/dbdirect/out/deu01deupe"
ROOT_DIR=${FILE%/in/*}

# ROOT_OUT="/sapdata/deubank/dbdirect/out/deu01deupe/out"
ROOT_OUT="$ROOT_DIR/out"

# ROOT_chk="/sapdata/deubank/dbdirect/out/deu01deupe/chk"
ROOT_CHK="$ROOT_DIR/chk"

mkdir "$ROOT_OUT"
mkdir "$ROOT_CHK"

cp "$FILE" "$ROOT_OUT"
cp "$FILE" "$ROOT_CHK/chk$FILE"

Not tested.

Thankx Mr. Vino .

Regds.
Srini