Linux / UNIX Tech Support Forum
This is a discussion on Alphabetical file name and list logged in user script within the Shell scripting forums, part of the Development/Scripting category; Hi, i couldnt figure out how to write this script. can any one help me ? please responce asap problem ...
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi, i couldnt figure out how to write this script. can any one help me ? please responce asap
problem 1: Write a shell script (/bin/sh) to write the names of the first (alphabetically) five files of the current directory to a new file called ‘zzz’. problem 2: Write a shell script (/bin/sh) called 'loggedOn' which is passed two usernames as command line parameters. Using the ‘who’ command, the script should see whether both users are logged on and, if so, should indicate which of them is logged onto the system the most times. If only one or neither is logged on, an error message should be written. |
| Sponsored Links | ||
|
|
|
|||
|
thanks for your help buddy. but the first problem u solved is not clear for me. because there is something i need to make, such as creat a new file and u didnt complete the whole thing
|
|
||||
|
Code:
#!/bin/sh ls | head -5 > zzz
__________________
Vivek Gite Linux Evangelist |
|
|||
|
don't you guys think that
Code:
ls | egrep -v '^[0-9]' | head -5 > zzz
|
|
||||
|
Quote:
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Getting the list of directory names into a file | hiddenrider007 | Shell scripting | 2 | 09-04-2008 09:59 AM |
| AIX /etc/security/user like file for Linux | ftengcheng | Getting started tutorials | 4 | 25-03-2008 01:28 AM |
| script for mailing to user the o/p of the script | ricc | Shell scripting | 3 | 11-07-2007 04:59 AM |
| list every user's crontab script | marinm | Shell scripting | 5 | 19-07-2005 11:24 PM |
| shell script for finding users not logged on for last 10 day | ganes | Shell scripting | 4 | 06-07-2005 11:01 AM |