Home » Infrastructure » Unix » using cut command
using cut command [message #98240] Sat, 22 May 2004 07:38 Go to next message
anil kumar
Messages: 16
Registered: August 2002
Junior Member
 

 Iam trying to use cut command from a shelll script. I am passing a parameter to a shell script($1). I would like to extract characters from 6 to 8 in that variable.

How can i do that?? can i use 'cut' for that??
Re: using cut command [message #98242 is a reply to message #98240] Mon, 24 May 2004 07:00 Go to previous messageGo to next message
Frank Naude
Messages: 4565
Registered: April 1998
Senior Member
Hi,

This is not exactly an Oracle question, but I will answer anyway:

Example script:

echo Argument 1 = [$1]
c=`echo $1 | cut -c6-8`
echo Characters 6 to 8 = [$c]


Output:

Argument 1 = [1234567890]
Characters 6 to 8 = [678]


Best regards.

Frank
Re: using cut command [message #98244 is a reply to message #98240] Mon, 24 May 2004 22:27 Go to previous message
Ramaraju
Messages: 2
Registered: May 2004
Junior Member
cut 6,8 <filename> - it will bring the 6 & 8 characters will be placed
Previous Topic: Oracle 9201 installation on AIX 5.1
Next Topic: Search a string in a folder
Goto Forum:
  


Current Time: Sun Sep 27 21:46:17 CDT 2020