• Post Reply Bookmark Topic Watch Topic
  • New Topic

how i appear a script?  RSS feed

 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i create a script .I have a text inside i return to the shell ,but how can i appear it this ?
 
Campbell Ritchie
Marshal
Posts: 56518
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know. Please show us how far you have got with the script.
 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Don't know. Please show us how far you have got with the script.
inside the script i have this .Script name is file1.I create it with vi file1 and on the script text is this:
#!/bin/sh

#filename

#---

echo "1.the process id is : $$ and cwd $PWD"

echo '2.the process id is : $$ and cwd $PWD '

echo 3.the process id is : $$ and cwd $PWD


after this i exit escape after i write this :qw! and i press enter .After what to do to appear it ?
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ekte spiriopoulos wrote:After what to do to appear it ?


Can you explain what you mean by "appear it"? Do you mean to run the shellscript?

Henry
 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
ekte spiriopoulos wrote:After what to do to appear it ?


Can you explain what you mean by "appear it"? Do you mean to run the shellscript?

Henry
exactly
 
Tim Holloway
Saloon Keeper
Posts: 18789
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Find someone with a better command of the English language to help you re-phrase the question.

We don't understand what "to appear it" means.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

First, your shellscript needs to be executable. Is it executable? If not, you can use the "chmod" command to make it so.

And once it is executable, you can run it, just like any other executable.

Henry
 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
First, your shellscript needs to be executable. Is it executable? If not, you can use the "chmod" command to make it so.

And once it is executable, you can run it, just like any other executable.

Henry
it is but i dont know how ...with what command
 
Liutauras Vilda
Sheriff
Posts: 4914
334
BSD
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ekte wrote:it is but i dont know how ...with what command

./scriptname.sh

after you do what Henry instructed you.
 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Liutauras Vilda wrote:
ekte wrote:it is but i dont know how ...with what command

./scriptname.sh

after you do what Henry instructed you.
thanks
 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Liutauras Vilda wrote:
ekte wrote:it is but i dont know how ...with what command

./scriptname.sh

after you do what Henry instructed you.
it didnt worked.I read again theory and i did sh file1 and it worked fine.Anyway thanks for your help
 
Liutauras Vilda
Sheriff
Posts: 4914
334
BSD
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome

What Henry mentioned you can do in this way:
and then
In case you don't want that, you can simply execute in one of those ways:
or

In Linux distributions default shell is bash (same as in Mac OS X), so run 1st line. FreeBSD default installation uses tcsh, so bash command wouldn't work, so you'd need to use sh interpreter.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!