Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-24-2005, 12:59 PM   #1
Registered: Sep 2004
Posts: 34

Rep: Reputation: 15
Shell scripting pros

I'm looking for some help from anyone who knows shell scripting, I'm trying to do the following:

1-Accept a string form the terminal and use case to echo a suitable message if the string doesn't have at least 10 characters.


2-Write a script that displays, in head-style, the last three lines of each file in the current directory, duly preceded by the filename.

Old 02-24-2005, 01:13 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66

if [ `echo -n $1|wc -m` -lt 10 ];then
 echo Less than 10 chars.
2) tail -vn 3 *
Old 02-24-2005, 01:13 PM   #3
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
/me sniffs the air ... "Eeeew, this reeks of homework!"

If this is a homework question, please read the RULES
again that you accepted when you signed up.



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
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
shell interface vs shell scripting? I'm confused jcchenz Linux - Software 1 10-26-2005 03:32 PM
Need help from pros in shell scripting? aLiVe Linux - Newbie 18 08-12-2004 09:37 AM
Need help from pros in shell script aLiVe Programming 1 08-08-2004 04:50 AM
Shell Scripting, I think... AMDPwred Linux - General 1 04-06-2002 12:01 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:38 PM.

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