LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-20-2013, 07:29 PM   #1
ChelseaNaomi
LQ Newbie
 
Registered: Oct 2013
Posts: 3

Rep: Reputation: Disabled
n00b homework help


How would one concert all the lowercase characters in a file called 'to_upper' to all uppercase characters?
Show how you would create a list of just the usernames contained in the /etc/passwd file?
Show how you would display how many times *one* person has logged in to Cidermill(server)?
Using redirect, show how to overwrite one file over another file. Show how to append one file onto the end of another file.
Give an example of how to redirect STDEER to a file.
Give an example of how to send STDOUT to *both* the console to a file.
Using awk, show how to input one like from /etc/passwd in the following order: UNAME, Home_dir, shell, UID
 
Old 10-20-2013, 07:40 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
No homework help here. At least you were honest.
 
Old 10-20-2013, 07:43 PM   #3
ChelseaNaomi
LQ Newbie
 
Registered: Oct 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
lol, we aren't allowed to ask for homework help on a forum? it's the same thing as asking questions.
 
Old 10-20-2013, 07:56 PM   #4
jkirchner
Member
 
Registered: Apr 2007
Location: West Virginia
Distribution: Ubuntu 14.04
Posts: 544

Rep: Reputation: 130Reputation: 130
Quote:
Originally Posted by ChelseaNaomi View Post
lol, we aren't allowed to ask for homework help on a forum? it's the same thing as asking questions.
No, check the rules for the forum

Now, if you want to say what the answers are and show the work you have done you may get some guidance.
 
1 members found this post helpful.
Old 10-20-2013, 07:56 PM   #5
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
Quote:
Originally Posted by LQ Rules
Do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and searches) and we'll do our best to help. Keep in mind that your instructor might also be an LQ member.
http://www.linuxquestions.org/linux/rules.html
 
Old 10-20-2013, 07:58 PM   #6
ChelseaNaomi
LQ Newbie
 
Registered: Oct 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Okay.
For the first one I tried:
tr [:lower:] [:upper:] < filename > filename
echo filename | tr '[a-z]' '[A-Z]' filename

Last edited by ChelseaNaomi; 10-20-2013 at 08:06 PM.
 
Old 10-20-2013, 08:27 PM   #7
JJJCR
Member
 
Registered: Apr 2010
Posts: 541

Rep: Reputation: 25
Hi Chelsea, my 2 cents of advice.
This a forum for professional people, if ever someone replied or give you an answers it might be somewhat complex or shortcut which I think might not be good.

You should learn the basic, good foundation and solid basic will help you for a very long time.

Shortcuts and just getting what you need will bite you back.

anyway you got a lot of questions,
Quote:
Show how to append one file onto the end of another file.
for this one:

you can use redirection operator (>>) $ echo "this is a new line" >> existing_file_add_to_the_end
 
Old 10-20-2013, 08:28 PM   #8
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 1,640

Rep: Reputation: 567Reputation: 567Reputation: 567Reputation: 567Reputation: 567Reputation: 567
Quote:
Originally Posted by ChelseaNaomi View Post
lol, we aren't allowed to ask for homework help on a forum? it's the same thing as asking questions.
As you have seen, the forum rules do not allow it...

But, if you are really trying to learn, putting forth the effort and in need of a little guidance, you will find most people here to be willing to help - even with homework - do not be discouraged!

And welcome to LQ!
 
1 members found this post helpful.
Old 10-20-2013, 08:33 PM   #9
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 1,640

Rep: Reputation: 567Reputation: 567Reputation: 567Reputation: 567Reputation: 567Reputation: 567
Quote:
Originally Posted by ChelseaNaomi View Post
Give an example of how to redirect STDEER to a file.
Give an example of how to send STDOUT to *both* the console to a file.
...
These fall under the general heading of shell file descriptors and redirection.

You will find a good starting point here, http://www.tldp.org/LDP/abs/html/io-redirection.html.

Read it and try to understand (it is technical, but hey, this is a technical subject!), try to figure it out by making your own examples, then come back and let us know if you need more help.
 
Old 10-20-2013, 09:15 PM   #10
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: infinity; (randomly born:) Milwaukee, WI, US, Earth
Distribution: any UNIXish that works well on my cheapest with mostly KDE, Xfce, JWM or CLI but open ;-)
Posts: 1,331
Blog Entries: 2

Rep: Reputation: 342Reputation: 342Reputation: 342Reputation: 342
Cool

Some, like teachers and books can tell you what to think but learning by [COLOR="Blue"]doing and thinking deeper about what was taught will get you to the tougher levels... http://meded.ucsd.edu/index.cfm//ugm...tudy_actively/

Last edited by jamison20000e; 10-25-2013 at 10:41 AM.
 
Old 05-30-2014, 06:39 AM   #11
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: infinity; (randomly born:) Milwaukee, WI, US, Earth
Distribution: any UNIXish that works well on my cheapest with mostly KDE, Xfce, JWM or CLI but open ;-)
Posts: 1,331
Blog Entries: 2

Rep: Reputation: 342Reputation: 342Reputation: 342Reputation: 342
Lightbulb

I don't quite love the 2nd link I gave, my favorite is \copyrighted:
Quote:
"Ten Study Tips for Dummies" ... from ... How to Make an A in Managerial Economics
It simply described passive and active study techniques; passive is what the teacher and book say, active is stopping to ponder what was said and form your own views on the subject!
Sorry it took so long...

Last edited by jamison20000e; 05-31-2014 at 07:42 AM.
 
Old 05-30-2014, 06:44 AM   #12
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,225

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Here are some useful links
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/

Take one of your qns at a time, read the links and try to create your own code.
If you get stuck, post your code here, using code tags https://www.linuxquestions.org/quest...do=bbcode#code .

Last tip; this
Code:
set -xv
is a great debugging cmd for shell scripts.
 
1 members found this post helpful.
Old 05-30-2014, 07:49 AM   #13
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,364
Blog Entries: 2

Rep: Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981
Just to clarify: Posting homework questions is not against the rules. It is fine for us of a member asks for help with homework questions, but we want to see an effort from the person asking those questions. Show us what you have done already and where you have problems and we are happy to help.
 
1 members found this post helpful.
Old 05-30-2014, 09:17 AM   #14
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,134

Rep: Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456Reputation: 2456
TobiGSD put it best, ChelseaNaomi. We will be very happy to help you, but you do have to show us what effort you have put forth first. To get you started, the best thing would be to think about each question, and what steps you need to take to accomplish them.
Quote:
Originally Posted by ChelseaNaomi
  1. How would one concert all the lowercase characters in a file called 'to_upper' to all uppercase characters?
  2. Show how you would create a list of just the usernames contained in the /etc/passwd file?
  3. Show how you would display how many times *one* person has logged in to Cidermill(server)?
  4. Using redirect, show how to overwrite one file over another file. Show how to append one file onto the end of another file.
  5. Give an example of how to redirect STDEER to a file.
  6. Give an example of how to send STDOUT to *both* the console to a file.
  7. Using awk, show how to input one like from /etc/passwd in the following order: UNAME, Home_dir, shell, UID
So:
  1. Look at the passwd file. Where are the user names, and what is the delimiter (character/string that 'breaks' one field from another) between those fields?
  2. Assuming Cidermill is your school's server...not sure what we can tell you about this.
  3. Since you know how to get a file to the screen using cat (presumably), read the man pages, and check Google for redirection help. A single > will write to another file. Two will append.
  4. See previous answer for hints
  5. See previous two answers, and check the man page for tee.
  6. Your teacher gave you the answer to the first question, by suggesting awk here. Apply the hints about delimiters given to you.
 
Old 05-31-2014, 02:06 AM   #15
SandsOfArrakis
Member
 
Registered: Apr 2012
Location: Netherlands
Distribution: Mint 17 Cinnamon
Posts: 92

Rep: Reputation: Disabled
Personally I think that the OP has already finished her homework since the topic is half a year old, and she hasn't responded since.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



All times are GMT -5. The time now is 02:28 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration