Click to See Complete Forum and Search --> : html extension


hotlantas69
05-16-2004, 09:00 PM
I'm tryin to write a script that has to find all files in current directory with an html ext. and contain URL with my user id. I have to input my user id as a command line argument and have the script display names of the files along with a count of the files found and then show the command to execute them.

never done this before. I know how to execute it and count files , just don't in VI how to set it up.

bsh152s
05-19-2004, 04:53 PM
#!/bin/bash

# List files with html extension
# $1 will contain username given on command line
ls *.html | grep $1
...


I'm assuming you just wanted to know how the file should be set up. Just start the file with the "#!/bin/bash". Seems like a pretty simple script, but don't quite understand everything you're asking for.

sharth
05-19-2004, 07:00 PM
and you can pipe that all through wc -l and it will show the number of files (probably...)