Current location: Hot Scripts Forums » Programming Languages » Perl » Simple Shell Script


Simple Shell Script

Reply
  #1 (permalink)  
Old 10-25-05, 11:59 AM
adubb adubb is offline
Newbie Coder
 
Join Date: Jan 2005
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Simple Shell Script

how would I write a simple shell script to read each line of a .txt file (that contains a username) Then echo for each line a command applied to that username...

So.... echo "vxquota -v Username"

using the quota command
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 10-27-05, 07:30 AM
ser ser is offline
Newbie Coder
 
Join Date: Jun 2005
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Perl example
Code:
#!/usr/bin/perl
use strict;
while(<>)
 {
   print "vxquota -v $_";
 }
Usage: ./example.pl file_names_with_usernames
Bash/sh exaple
Code:
#!/bin/bash
for USERNAME in `cat file_names_with_usernames` 
do
 echo "vxquota -v $USERNAME"
done
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Raffle/Lottery Script (Very profitable!), Coded it myself. Voltaire General Advertisements 6 03-16-09 08:15 AM
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 11:17 AM
Simple Banner Script n00bie Script Requests 0 03-08-05 12:29 AM
looking for simple photo gallery script rookie Script Requests 0 03-01-05 11:38 AM
Is there any integrity of script rankings? webmaster@atmanager.com Hot Scripts Forum Questions, Suggestions and Feedback 17 08-06-04 01:12 AM


All times are GMT -5. The time now is 12:14 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.