Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › New to bash scripting
New Posts  All Forums:Forum Nav:

New to bash scripting

post #1 of 2
Thread Starter 
Hey all, I've recently immersed myself in the world of bash scripting, and have found that it makes it really easy to get things accomplished fast. Anyway, I recently wrote up a script to pull out url's from an html file. This is what it looks like
Code:
#!/bin/bash
echo Wobsite: $1
echo Server: $2
for  in $(cat $1); do
grep "a href=" |cut -d"/" -f3 |grep "$2" |cut -d'"' -f1 |sort -u
done
My question is this, After the "for" command, what should be put there?

EDit

I know that it requires "for", well, not necessarily, but it gives an error after thee script completes if I don't have it. If I'm not mistaken, for it a loop command. I only through it in because after a ping/IP enumeration script I wrote, I had hostname in, I just removed hostname from after "for" and made a few other modifications...
Edited by Pap3r - 5/24/08 at 9:20pm
Mod
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 G0 @ 3390MHz Asus P5Q XFX 8800GT Alpha Dog Edition 767/1833 2x1g OCZ Reaper DDR2 
Hard DriveOptical DriveOSMonitor
WD 160G SATA Light-on Lightscribe Drive Ubuntu Syncmaster 730B 
KeyboardPowerCaseMouse
G15 Rosewill 550w SLI TT Tsunami MX518 
Mouse Pad
None 
  hide details  
Reply
Mod
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 G0 @ 3390MHz Asus P5Q XFX 8800GT Alpha Dog Edition 767/1833 2x1g OCZ Reaper DDR2 
Hard DriveOptical DriveOSMonitor
WD 160G SATA Light-on Lightscribe Drive Ubuntu Syncmaster 730B 
KeyboardPowerCaseMouse
G15 Rosewill 550w SLI TT Tsunami MX518 
Mouse Pad
None 
  hide details  
Reply
post #2 of 2
Thread Starter 
So I've come across this: http://www.ss64.com/bash/for.html Which explains for well, as well as eveyr other command on the previous page. I still don't know what it means by "expands words". I see the i and the m, but I don't know what significance they have.
Mod
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 G0 @ 3390MHz Asus P5Q XFX 8800GT Alpha Dog Edition 767/1833 2x1g OCZ Reaper DDR2 
Hard DriveOptical DriveOSMonitor
WD 160G SATA Light-on Lightscribe Drive Ubuntu Syncmaster 730B 
KeyboardPowerCaseMouse
G15 Rosewill 550w SLI TT Tsunami MX518 
Mouse Pad
None 
  hide details  
Reply
Mod
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 G0 @ 3390MHz Asus P5Q XFX 8800GT Alpha Dog Edition 767/1833 2x1g OCZ Reaper DDR2 
Hard DriveOptical DriveOSMonitor
WD 160G SATA Light-on Lightscribe Drive Ubuntu Syncmaster 730B 
KeyboardPowerCaseMouse
G15 Rosewill 550w SLI TT Tsunami MX518 
Mouse Pad
None 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › New to bash scripting