Commands to run from shell script | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Commands to run from shell script

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-12-2012
Ramrangasamy Ramrangasamy is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 14 December 2012, 7:29 AM EST
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Commands to run from shell script

Hi


Code:
script> isumid 98765432

if i give above command in cmd prompt it is running the same thing if i give inside the shell script it is not working


below is the code


Code:
#!/bin/bash
 
isumid 98765432

please give me a solution

Last edited by Scott; 12-12-2012 at 11:14 AM.. Reason: Code tags
Sponsored Links
    #2  
Old 12-12-2012
Scott's Avatar
Scott Scott is offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 21 October 2014, 2:03 PM EDT
Location: Zürich
Posts: 8,484
Thanks: 332
Thanked 1,047 Times in 914 Posts
Please be more specific about what "is not working" means.

What shell are you using from the command line?
Sponsored Links
    #3  
Old 12-12-2012
phunk phunk is offline
Registered User
 
Join Date: Nov 2012
Last Activity: 28 February 2014, 3:57 PM EST
Posts: 35
Thanks: 3
Thanked 1 Time in 1 Post
What error are you receiving? (If any - it's just as important for us to know if you get no response from the shell)
    #4  
Old 12-12-2012
Ramrangasamy Ramrangasamy is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 14 December 2012, 7:29 AM EST
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
i have created below script

script name = "first"


Code:
#!/bin/bash

isumid 98765432


and i go back to command prompt and run it like below


Code:
script > sh -x first

getting below output


Code:
+ isumid 98765432
first: line 2: isumid: command not found
script>

but if i give like below


Code:
script>isumid 98765432  "it is working"


Last edited by Scott; 12-12-2012 at 11:24 AM.. Reason: Code tags
Sponsored Links
    #5  
Old 12-12-2012
phunk phunk is offline
Registered User
 
Join Date: Nov 2012
Last Activity: 28 February 2014, 3:57 PM EST
Posts: 35
Thanks: 3
Thanked 1 Time in 1 Post
Please use code and icode tags. Is it just first? Not first.sh, first.bat, something like that?

What happens if you type:

script>./first
Sponsored Links
    #6  
Old 12-12-2012
Yoda's Avatar
Yoda Yoda is offline Forum Advisor  
Jedi Master
 
Join Date: Jan 2012
Last Activity: 21 October 2014, 3:54 PM EDT
Location: Galactic Empire
Posts: 3,387
Thanks: 235
Thanked 1,209 Times in 1,135 Posts
Always use absolute path if you are trying to run an executable that is not defined in PATH environment variable in BASH. So you should try:-

Code:
/path_of_isumid/isumid 98765432

Or add absolute path of executable isumid to PATH env variable.

Code:
export PATH="$PATH:/path_of_isumid"

I hope this helps.
Sponsored Links
    #7  
Old 12-12-2012
Ramrangasamy Ramrangasamy is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 14 December 2012, 7:29 AM EST
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
if i give script>./first - it is saying

-sh: ./first: permission denied

---------- Post updated at 09:59 PM ---------- Previous update was at 09:55 PM ----------

Thanks all ...let me add absolute path and try

---------- Post updated at 10:00 PM ---------- Previous update was at 09:59 PM ----------

where do we add absolute path since am new to this unix
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
shell script to run commands in different terminals saidopdf Shell Programming and Scripting 2 08-15-2012 02:44 PM
Shell script to run commands linuxrose Shell Programming and Scripting 7 04-01-2011 02:02 AM
Run a shell script from one host which connext to remote host and run the commands SN2009 Shell Programming and Scripting 6 04-13-2009 04:39 AM
shell script to run a few commands help! perk_bud Shell Programming and Scripting 23 07-06-2007 03:34 AM
How to run unix commands in a new shell inside a shell script? hkapil Shell Programming and Scripting 2 01-04-2006 05:56 AM



All times are GMT -4. The time now is 03:57 PM.