LinuxQuestions.org
Help answer threads with 0 replies.
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 04-18-2006, 11:44 AM   #1
schranky54
LQ Newbie
 
Registered: Apr 2006
Posts: 1

Rep: Reputation: 0
Can anyone write scripts good?


Can anyone lend me a hand in this?

1- Write a script called lsh to display a message giving the number of hidden files in the current directory and then display the hidden files.

2- Write a script called whoon that will display a message stating the number of users currently logged on and then list those users (in columns). (Note to do this in columns, you will need to use utilities that we have not discussed. Do a listing on the /bin directory to see the available utilities and then use the man pages to see what some of the utilities do.) Also note that each user logged in must only be counted once, no matter how many times they are logged in. It is best to secure shell to apollo to do this exercise.

Last edited by schranky54; 04-18-2006 at 11:52 AM.
 
Old 04-18-2006, 11:51 AM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
This should help
Code:
#!/bin/bash

for i in $(seq 1 5) ; do
echo $i. Do your own homework
done

Last edited by homey; 04-18-2006 at 11:54 AM.
 
Old 04-18-2006, 12:03 PM   #3
ultramancool
Member
 
Registered: Jul 2004
Location: Hell
Distribution: Gentoo 2005.1 r1
Posts: 92

Rep: Reputation: 15
Quote:
Originally Posted by schranky54
Can anyone lend me a hand in this?

1- Write a script called lsh to display a message giving the number of hidden files in the current directory and then display the hidden files.

2- Write a script called whoon that will display a message stating the number of users currently logged on and then list those users (in columns). (Note to do this in columns, you will need to use utilities that we have not discussed. Do a listing on the /bin directory to see the available utilities and then use the man pages to see what some of the utilities do.) Also note that each user logged in must only be counted once, no matter how many times they are logged in. It is best to secure shell to apollo to do this exercise.
I would recommend you learn perl.
 
Old 04-18-2006, 12:10 PM   #4
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
lol, homework "Also note that each user logged in must only be counted once, no matter how many times they are logged in. It is best to secure shell to apollo to do this exercise."

It's against the rules.

If you're doing an exercise in some self help tutorial, people telling you defeats the purpose.
 
Old 04-18-2006, 03:19 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by schranky54
Can anyone lend me a hand in this?

1- Write a script called lsh to display a message giving the number of hidden files in the current directory and then display the hidden files.

2- Write a script called whoon that will display a message stating the number of users currently logged on and then list those users (in columns). (Note to do this in columns, you will need to use utilities that we have not discussed. Do a listing on the /bin directory to see the available utilities and then use the man pages to see what some of the utilities do.) Also note that each user logged in must only be counted once, no matter how many times they are logged in. It is best to secure shell to apollo to do this exercise.
2
Homework!!!
1. Against the rules
2. Pretty transparent when you just paste in the instructor's words....

While learning Linux (presumably to enter the job market), you will also want to learn English. You can write good scripts, or you can write scripts WELL.
good=adjective
well=adverb
 
Old 04-18-2006, 06:09 PM   #6
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
And pay attention to the bottom line of pixellany's sig
 
Old 04-18-2006, 07:09 PM   #7
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,116

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
This is a fairly simple script. Glad to give you a hand!

Code:
#!/bin/bash
echo Zl grnpure vf n zbeba naq jvyy cebonoyl tvir zr na N sbe guvf nffvtazrag | tr A-Za-z N-ZA-Mn-za-m
 
Old 04-18-2006, 08:57 PM   #8
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
Quote:
While learning Linux (presumably to enter the job market), you will also want to learn English. You can write good scripts, or you can write scripts WELL.
good=adjective
well=adverb
ZING !
 
Old 04-18-2006, 09:17 PM   #9
sumguy231
Member
 
Registered: Apr 2004
Location: North America
Distribution: Kubuntu 7.04 - Feisty Fawn
Posts: 296

Rep: Reputation: 30
Quote:
While learning Linux (presumably to enter the job market), you will also want to learn English. You can write good scripts, or you can write scripts WELL.
good=adjective
well=adverb
That's a bit insensitive, as these are international forums; English might not be the OP's native language.
Edit: I noticed this is a homework assignment. That is explicitly against the rules of this forum.

Last edited by sumguy231; 04-18-2006 at 09:20 PM.
 
Old 04-19-2006, 12:02 AM   #10
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by sumguy231
That's a bit insensitive, as these are international forums; English might not be the OP's native language.
Normally, I practice extreme tolerance. However, when someone is so egregious as to paste in the instructor's words, then they are likely to get zinged. Further, I am learning to distinguish ESL from simply "ain't lerned da eglish" I put the OP in the latter group.

Finally, **extensive studies** indicate that this person is a "one-poster" and will not be heard from again.
 
Old 04-19-2006, 05:10 PM   #11
sumguy231
Member
 
Registered: Apr 2004
Location: North America
Distribution: Kubuntu 7.04 - Feisty Fawn
Posts: 296

Rep: Reputation: 30
Them is some gooderer points then mine. I wasn't really after you in particular though.

Last edited by sumguy231; 04-19-2006 at 09:33 PM.
 
Old 04-19-2006, 06:55 PM   #12
towy71
Member
 
Registered: Oct 2003
Location: Carmarthen, Wales
Distribution: Ubuntu and whatever is new kid on the block
Posts: 70

Rep: Reputation: 18
excuse me, now extracting foot from mouth

Last edited by towy71; 04-19-2006 at 07:05 PM.
 
  


Reply

Tags
homework


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can i write Lilo scripts? em00guy Linux - Software 2 07-14-2005 04:47 PM
I have some scripts that I need to write.... Meekal Programming 2 12-05-2004 05:03 PM
Some scripts I need to write.... Meekal Linux - General 1 12-05-2004 05:01 PM
Write-protection in scripts Louis_Carole Linux From Scratch 1 09-03-2004 12:22 AM
need to re-write boot scripts (rc.d) qwijibow Slackware 8 06-30-2004 12:03 PM


All times are GMT -5. The time now is 12:11 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration