- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- General
- >
- script skill
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- 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
- Email to a Friend
- Report Inappropriate Content
04-25-2003 10:48 AM
04-25-2003 10:48 AM
script skill
2. what is basename used for?
3. where is ".profile" place usually?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-25-2003 12:41 PM
04-25-2003 12:41 PM
Re: script skill
Hi,
1- Usually in Linux/UNIX we don't sepcify a file extension. The script is immediately saved with no extension. use ls -l for more details.
2- No info.
3- Under the home directory, example: /home/admin/.profile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-25-2003 01:12 PM
04-25-2003 01:12 PM
Re: script skill
1. If you are wondering if a variable containing a filename has an extension, here is one way to possibly get it using parameter expansion:
f=myfile.txt
b=${f##*.}
echo $b
txt
2. The basename function will take a filename with a path as an argument and will return the filename with all the directory path removed, something like this:
$ basename /somebig/dir/myfile.txt
myfile.txt
3. In your home directory.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-28-2003 06:11 AM
04-28-2003 06:11 AM
Re: script skill
#! /bin/ksh
Says use the k shell.
-Although, you don't necessarily need that, you can tell it to run with whatever interepreter you want by prefixing your script with the interepreter...
/bin/ksh script
-If you do include the interpreter in the top line (yes, it looks like a comment), you will need to change the script to be executable.
chmod + x script
(+x means add execuateble for all)
-Other answers given were fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-28-2003 06:31 AM
04-28-2003 06:31 AM
Re: script skill
Your questions were answered, but please spend time to provide points to the people who took some of their time to answer you back. This will encourage all to respond to you back in a good way.
thanks,
Umapathy
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP