Home » Infrastructure » Unix » cut command in Unix
cut command in Unix [message #97709] Mon, 25 November 2002 11:56 Go to next message
VJ
Messages: 24
Registered: June 2002
Junior Member
I have to get cut a variable (i.e., a filename) into two parts. I,e if the file name is client.c then i should store the client in one variable and c in another variable
Re: cut command in Unix [message #97714 is a reply to message #97709] Wed, 27 November 2002 03:12 Go to previous messageGo to next message
Sujit Mahapatra
Messages: 19
Registered: March 2002
Junior Member
This should work:

var1=`echo client.c | cut -d"." -f1`
var2=`echo client.c | cut -d"." -f2`
Re: cut command in Unix [message #97816 is a reply to message #97714] Fri, 14 February 2003 17:23 Go to previous messageGo to next message
Todd
Messages: 17
Registered: October 2000
Junior Member
I am trying to cut all the delimiters out of a file with both # and : as delimiters. I have tried just about everything. I am working with perl. any suggestions on how to use the cut command to do this?
Re: cut command in Unix [message #131533 is a reply to message #97816] Mon, 08 August 2005 02:10 Go to previous message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
you can try this

@arr = split(',','abc,xyz,def');
print "@arr";


otherwise you can use $arr[0], $arr[1] and $arr[2].

by
vamsi
Previous Topic: how to start OMS at solaris unix env?
Next Topic: Upgrade 8.1.7 to 10g.
Goto Forum:
  


Current Time: Wed Apr 24 07:47:46 CDT 2024