Visit Our UNIX and Linux User Community


key detection in a script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting key detection in a script
# 8  
Old 02-29-2008
As for the second part of your question enoch99:
Try this one:

#!/bin/sh
script content

if you execute this (./scriptname) and it is executable, then it should be executed using #!/bin/sh
# 9  
Old 06-28-2009
possible.I think

you can put the file "script.sh" in /usr/bin .But you will need to have root permissions. you can do that by
sudo mv (or mv -i or cp -i to be safe) script.sh /usr/bin
and then enter your password when prompted.
Any program you have, even a simple c program executable you create can be run by just typing the executable name if it is present in /usr/bin . you can even remove the .sh extension if you want to i guess.I am just an amateur user of UNIX with hardly an year of experience.My apologies for any mistakes.
# 10  
Old 06-28-2009
Quote:
Originally Posted by saiganeshb
you can put the file "script.sh" in /usr/bin .But you will need to have root permissions. you can do that by
sudo mv (or mv -i or cp -i to be safe) script.sh /usr/bin

That's not a good place to put it. That should contain only system-provided commands. The better place is /usr/local/bin, or, if it's just for your own use, $HOME/bin.
Quote:
and then enter your password when prompted.
Any program you have, even a simple c program executable you create can be run by just typing the executable name if it is present in /usr/bin .

It can be run by just typing the executable name if it is present in ANY directory in your $PATH.

Previous Thread | Next Thread
Test Your Knowledge in Computers #782
Difficulty: Medium
Bill Gates dropped out of Yale University to start his own company
True or False?

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Script @ Find a key word and If the key word matches then replace next 7 lines only

Hi All, I have a XML file which is looks like as below. <<please see the attachment >> <?xml version="1.0" encoding="UTF-8"?> <esites> <esite> <name>XXX.com</name> <storeId>10001</storeId> <module> ... (4 Replies)
Discussion started by: Rajeev_hbk
4 Replies

2. Programming

Parallel Processing Detection and Program Return Value Detection

Hey, for the purpose of a research project I need to know if a specific type of parallel processing is being utilized by any user-run programs. Is there a way to detect whether a program either returns a value to another program at the end of execution, or just utilizes any form of parallel... (4 Replies)
Discussion started by: azar.zorn
4 Replies

3. Solaris

Solaris 8 ssh public key authentication issue - Server refused our key

Hi, I've used the following way to set ssh public key authentication and it is working fine on Solaris 10, RedHat Linux and SuSE Linux servers without any problem. But I got error 'Server refused our key' on Solaris 8 system. Solaris 8 uses SSH2 too. Why? Please help. Thanks. ... (1 Reply)
Discussion started by: aixlover
1 Replies

4. Shell Programming and Scripting

need bash script Intrusion Detection on Linux

Hello all I have a script but I failed on the creation of Script is any is carried out in the shell sends the owner of the server, the message is has been implemented For example, functioned as a detection system intruders but in smaller Is it possible to help if you allow I want the... (4 Replies)
Discussion started by: x-zer0
4 Replies

5. Shell Programming and Scripting

File detection then run script

I am currently running 4 scripts to complete a job for me. Each script requires the finished file of the one before it. For example the first script gets the finished file called model.x, then i would like script2 to start in and use model.x as the input and get model_min.x as the finished... (5 Replies)
Discussion started by: olifu02
5 Replies

6. Shell Programming and Scripting

Backspace Key From Within Script

I have a script that asks a user for a few question. I would like the users to be able to use the backspace key if they make a mistake. Right now when they try they get ^? instead of it backing up. As you can see here from a stty -a the backspace is set... speed 38400 baud; rows = 42;... (2 Replies)
Discussion started by: LRoberts
2 Replies

7. Shell Programming and Scripting

A simple intrusion detection script

If you have a very static Linux server and you want to make sure it's not messed with, here's a simple script that will tell you if any files have been tampered with. It's not as fancy or as secure as tripwire or those others, but it is very simple. It can be easily adapted to any *NIX OS. ... (3 Replies)
Discussion started by: otheus
3 Replies

8. UNIX for Dummies Questions & Answers

Pressing backspace key simulates enter key

Hi, Whenever i press the backspace key, a new line appears, i.e. it works like a enter key. :confused: Thanks (2 Replies)
Discussion started by: vibhor_agarwali
2 Replies

Featured Tech Videos