- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- vi confusing?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2001 01:27 AM
07-23-2001 01:27 AM
I edit a script with vi plus the option -x, how to make it excuteable?
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2001 01:32 AM
07-23-2001 01:32 AM
Re: vi confusing?
Just use the chmod command, for example: chmod -x [file name] will make it executable for the owner, group and others.
chmod 700 [file name] will make it readable, writable and executable for the owner.
see "man chmod"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2001 01:37 AM
07-23-2001 01:37 AM
Re: vi confusing?
#sh ./script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2001 01:38 AM
07-23-2001 01:38 AM
Re: vi confusing?
chmod 755 <script>
makes the script readable and executable for owner,group and others as well as writable for owner.
Andreas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2001 01:51 AM
07-23-2001 01:51 AM
Re: vi confusing?
After completing the edit job, save and come out. Then use this
#chmod 755 script . Now owner, group, and others will executable permission.
#chmod 744 script Here only owner will have execute permission.
U can try this alos
#sh ./script
Best of luck
Shahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2001 02:09 AM
07-23-2001 02:09 AM
Re: vi confusing?
Key:
"to.sh" [New file]
$chmod +x to.sh
$./to.sh
./to.sh: syntax error at line 2 : `newline or ;' unexpected
while I do as follow:
$vi to.sh
$chmod +x to.sh
$./to.sh
It is OK now!
Why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2001 02:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2001 12:46 PM
07-23-2001 12:46 PM
Re: vi confusing?
vi doesn't change permisions on files (like to make it executable). Like they said here, that's "chmod". vi edits files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2001 12:45 PM
07-24-2001 12:45 PM
Re: vi confusing?
If you are using a vim or some other vi clone -x encrypts the file. A quick way to continue editing and to change the execute status is to do a :w file.sh then a :!chmod +x file.sh
You can execute from within the editor the same way :!./file.sh
Assuming that the first line of the script is #!/bin/sh etc..