The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help - shell script newbie eback Shell Programming and Scripting 2 10-15-2007 06:28 PM
Shell Scripting Newbie mattyjim2 UNIX for Dummies Questions & Answers 1 10-11-2007 07:20 AM
A few questions from a newbie(shell script) perk_bud Shell Programming and Scripting 5 07-21-2007 06:59 AM
NEWBIE: If and Find in shell script meskue Shell Programming and Scripting 1 06-30-2006 02:28 AM
Newbie using sed in a shell script ktoz Shell Programming and Scripting 1 05-26-2003 06:07 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 06-08-2009
hotcutiepie05 hotcutiepie05 is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 1
Question Shell Script Help -I'm a newbie

Can someone help me write this shell script?
I am completely new to shell and as a fun task my uncle has challenged me a problem (out of all other people). Basically, all he wants me to do is to create backup file in a folder that is named “disables.”
This is what he said: create a shell script to backup all “profiles” with are disabled (or inactive) before you start deleting those files.

Here is what he provided me with, I am supposed to use/ manipulate his previously used script so it works for me and what I need to get done. From what I understand he wants me to find certain profiles that are “disabled” and put them into a txt file: disabled.txt but I have no clue how to code this...I've never used Shell in my life =(


Code:
home1:t13hal2/backups # wlsmon -s $h > $h.sh
home1:t13hal2/backups # cd ..
home1:t13hal2 # ls
.profile*             MonitorTypes.sh*      cmdfile.sh            inputFile.txt
.sh_history           all_dm_profiles.txt   disabled.sh*          logfile
.vi_history           backups/              disabled.txt

home:t13hal2 # cat disabled.sh
#!/bin/sh

wlookup -Lar SentryProfile |grep -v @ > all_profiles.txt

while read h;do 
discount=`wlsmon $h |grep -c disabled` 
if [ $discount -gt 0 ];then 
echo "PROFILE:$h    COUNT:$discount" 
fi 

done < all_profiles.txt

ANY HELP WILL BE APPRECIATED...THANKS IN ADVANCE

Last edited by vidyadhar85; 06-08-2009 at 10:54 PM.. Reason: code tag added
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:18 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0