Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Length of $1 variable? 1

Status
Not open for further replies.

Scunningham99

Programmer
Sep 20, 2001
815
GB
Hi

We have an application wherby the user types in the name of a file. We need to capture this name in text so we can use it for another part of the applciation which ftp's the file. for example:-

user types : ups

So we would need to capture ups and append .csv

So ups.csv would be used later in the program.

Our application passes a string of variables to unix via $1.

The field we need is the eigth one, so we cut this out as follows:-

USER_PARAMS="`echo $1|cut -f8 -d=`"
#echo $USER_PARAMS

FILE_NAME="`echo $USER_PARAMS|cut -c4-4`" <<--

This is the bit im struggling on for ideas as the user could type in ups, parcelforce etc so how can i make this bit dynamic?

Sy UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top