LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Closed Thread
  Search this Thread
Old 04-29-2008, 05:16 AM   #1
ch4920
LQ Newbie
 
Registered: Apr 2008
Posts: 3

Rep: Reputation: 0
help with homework


newbie here. i am writing a bash script and when i use wc -l filename to get a line count it returns the line count and the file name. i would like to get the line count(only, not the filename) and store it in a variable. also i need to get the process id of the script and store that in a variable too. any help is greatly appreciated. thank you
 
Old 04-29-2008, 05:29 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.


http://www.linuxquestions.org/questi...mework-638614/
 
Old 04-29-2008, 08:57 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,642
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
Yes, and if this is homework, and given that the answer is easily found on the man-page, why don't you embrace the purpose of the exercise and discover the answer for yourself?

If you want to be in the computer industry, one of the most crucial skills that you must acquire is the refined ability to find answers. And, the ability to resourcefully invent answers should the need arise. In the rather-controlled environment of a classroom, you can encounter this sort of requirement (and discover whether or not you are any good at it) without the pressure. If you "dodge" that, you're not only cheating , but you're cheating yourself out of the very education that you supposedly signed-up to get.
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help w/ homework ch4920 Linux - Newbie 5 04-29-2008 08:01 AM
Homework pixellany LQ Suggestions & Feedback 14 06-30-2006 07:20 AM
homework help louce Linux - Newbie 3 09-04-2005 08:00 PM
help me(my homework) please! donotexpert Programming 4 08-20-2005 06:26 AM
Need homework help! bumstickie Linux - Newbie 3 10-28-2002 04:37 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration