Reputation: 1112
I know how to use cut in a text file or in pipe line. But when it comes to using cut in ksh, I am having some difficulty dealing with it.
#!/bin/ksh
...
result=$(cut -d: -f1 string) //assume string = "first:second:third"
print $result //I want to print out "first"
when I do this I got my stdout saying that cut cannot open string. Which I kind of know why because cut is for file. What should I do to archieve my goal?
Upvotes: 1
Views: 8281