Computing.Net > Forums > Unix > Korn shell cut question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Korn shell cut question

Reply to Message Icon

Name: eversmiler
Date: January 12, 2006 at 13:03:03 Pacific
OS: 2000
CPU/Ram: Intel P4 512
Comment:

I use the following command on the command line:
print test.one.two | cut -d\. f1
and the output is test
when i use the same command in my shell script:
filename=test.one.two | cut -d\. f1
print $filename
it does not print anything
would someone please help me undestand
thank you

Ever Smiler



Sponsored Link
Ads by Google

Response Number 1
Name: vicchai
Date: January 13, 2006 at 06:12:08 Pacific
Reply:

Try this:

filename=`print test.one.two | cut -d\. f1`


0

Response Number 2
Name: eversmiler
Date: January 13, 2006 at 12:01:04 Pacific
Reply:

Thank you for the response.
I tried the command, but the output I got is:
print test.one.two|cut -d\. -f1

whereas the output I was expecting is: test

Ever Smiler


0

Response Number 3
Name: ghostdog
Date: January 13, 2006 at 18:20:46 Pacific
Reply:

hi
did you do an

echo $filename ?


0

Response Number 4
Name: eversmiler
Date: January 16, 2006 at 12:04:49 Pacific
Reply:

ghostdog

Yes, I did!
As a matter of fact, I tried both:
echo $filename and
print $filename and received the same output as outlined above.

Any more help would be appreciated.

Ever Smiler


0

Response Number 5
Name: David Perry
Date: January 17, 2006 at 05:58:35 Pacific
Reply:

Those marks are backticks ( look below the tilde character ) not single quotes.


0

Related Posts

See More



Response Number 6
Name: eversmiler
Date: January 18, 2006 at 07:05:02 Pacific
Reply:

Woo Hoo!
That worked!
Thank you all for your help.
Vicchai did have it in his response, but it took Perry's to point out the ticks to me.
Thank you again you nice people for taking the time.

Ever Smiler


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Korn shell cut question

Korn shell script doubt ??? www.computing.net/answers/unix/korn-shell-script-doubt-/3407.html

Substring in Korn Shell Script www.computing.net/answers/unix/substring-in-korn-shell-script/5540.html

korn shell help please www.computing.net/answers/unix/korn-shell-help-please/4364.html