The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need to create file from shell scripting smr_rashmy Shell Programming and Scripting 4 01-28-2008 10:59 PM
FTP is using shell scripts create ? for file a501420038 Shell Programming and Scripting 1 08-16-2007 02:39 PM
Read words from file and create new file using K-shell. bsrajirs Shell Programming and Scripting 4 06-01-2007 12:15 PM
How do I create desktop icons for the shell programs I create??? TRUEST UNIX Desktop for Dummies Questions & Answers 7 05-15-2002 11:40 AM
create a periodic execution of a script? hoang UNIX for Dummies Questions & Answers 3 04-17-2002 11:38 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-22-2006
heru_90's Avatar
heru_90 heru_90 is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 65
How to create file execution in KSH shell

Dear all,

I'm new in Unix system, I need help about how to create execution file.
for example in my system i have file fg*
when i open fg file i get :
cmd='basename$0'
$cmd "$@"

how to create file like that (execution file) in KSH shell

thank you for your help


heru
  #2 (permalink)  
Old 06-22-2006
grumpf grumpf is offline
Registered User
  
 

Join Date: May 2006
Posts: 101
IFF i understand correctly you are trying to create a file an execute it ?
(Note: there are better ways )

try someting like this:

cat <<EOF >/tmp/myexecuteable
#!/bin/sh
echo "hello world"
EOF

chmod +x /tmp/myexecuteable
/tmp/myexecuteable
  #3 (permalink)  
Old 06-23-2006
heru_90's Avatar
heru_90 heru_90 is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 65
Thumbs up Thank's for you help

thank's Grumpf for your help, this work..

have nice day


heru
  #4 (permalink)  
Old 06-23-2006
grial's Avatar
grial grial is offline Forum Advisor  
El UNIX es como un toro
  
 

Join Date: Jun 2006
Location: Madrid (Spain)
Posts: 531
Quote:
Originally Posted by grumpf
...
chmod +x /tmp/myexecuteable
/tmp/myexecuteable
This will also work:
Code:
...
sh /tmp/myexecuteable
...
Regards.
  #5 (permalink)  
Old 06-23-2006
grumpf grumpf is offline
Registered User
  
 

Join Date: May 2006
Posts: 101
next step is to use 'exec /tmp/myexecuteable'
to save some 0.002us and a few more bytes
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:38 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0