run script without ./scriptname


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers run script without ./scriptname
# 1  
Old 04-08-2007
run script without ./scriptname

Hi everyone,

I'm very new, I just wrote a script "Hello World" Smilie LOL

How can I execute the script without the ./myscript.

I want to just type "myscript" basically from anywhere without the " ./ ".

Thanks a bunch,
NinjaX
# 2  
Old 04-08-2007
For that you have to do one of two things:
1. Put the script in one of the directories specified in your $PATH variable
2. Change your $PATH variable to include the directory that your script is in
# 3  
Old 04-08-2007
Thanks Torch

I'm a long way from smart, but I do feel smarter now.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies

2. Shell Programming and Scripting

Should I run scripts like sh /absolute_path/to/scriptname.sh or just /absolute_path/to/scriptname.sh

Shell : Linux Bash OS version : RHEL 6.X, Oracle Linux 6.X Question1. To execute shell scripts, sometimes I see Linux admins placing sh command before shell scripts like below sh /home/appadmin/sync_pending_orders.shBut, I execute shell scripts like below ie. Just the absolute path ... (4 Replies)
Discussion started by: John K
4 Replies

3. Shell Programming and Scripting

Search jobname via scriptname in autosys

Hi I was wondering if there was any command with autorep that can be used to check what the jobname is by givin scriptname that is defined in the JIL of the job (1 Reply)
Discussion started by: sidnow
1 Replies

4. Shell Programming and Scripting

Script fails to run properly when run from CRONTAB

Hello all, I'm trying to write a script to gather and send data and it works just fine at the bash command line, but when executing from CRON, it does not run properly. My scripting skills are pretty limited and there's probably a better way, but as I said it works at the command line, but... (12 Replies)
Discussion started by: rusman
12 Replies

5. Solaris

Need to execute the script with script name wihtout using ./scriptname in Solaris 10

Hi, I am using solaris 10.Is there any way to execute the script with the scriptname wihtoug using ./scriptname?Also does it varies from shell to shell.I have scripts in bash,ksh,sh shells. Example:script.sh is the script name.I need to execute the script like this script.sh instead... (4 Replies)
Discussion started by: muraliinfy04
4 Replies

6. Shell Programming and Scripting

how to run an already made script run against a list of ip addresses solaris 8 question

how to run an already developed script run against a list of ip addresses solaris 8 question. the script goes away and check traffic information, for example check_GE-VLANStats-P3 1.1.1.1 and returns the results ok. how do I run this against an ip list? i.e a list of 30 ip addresses (26 Replies)
Discussion started by: llcooljatt
26 Replies

7. Shell Programming and Scripting

/bin/ksh: scriptname: not found. ???

I have started to write Korn scripts on the client's AIX 4.2 servers and there is this small problem that puzzles me. I code all my scripts the same way: - first line contains : #!/bin/ksh - I do this console command on every scripts: chmod +x scriptname But still, on some occasions,... (4 Replies)
Discussion started by: Browser_ice
4 Replies

8. Solaris

bash: ./<scriptname>: No such file or directory

I have simply downloaded a file to my local folder, made one small change and uploaded it back, ever since it will not run the file. I have now uploaded the original, unchanged file, which still doesn;t work. Evertime it is run ot says bash: ./nrcardprint: No such file or directory The... (10 Replies)
Discussion started by: Heidi.Ebbs
10 Replies

9. Shell Programming and Scripting

echo Scriptname

I have several crontab scripts running which email me status. Some of these scripts perform identical tasks so I get a similar emails sent to myself. How do I get the script to print it's own path/filename so I can include it in the status updates without hardcoding trhe filename into the... (1 Reply)
Discussion started by: uXion
1 Replies
Login or Register to Ask a Question