LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-14-2010, 01:22 PM   #1
putrye
LQ Newbie
 
Registered: Dec 2010
Posts: 1

Rep: Reputation: Disabled
help please anyone!


how can i write a shell script that takes a file path as command-line arguments.and it should report whether the path denotes a file or a directory.
thank youuu
 
Old 12-14-2010, 01:26 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,921

Rep: Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690
Quote:
Originally Posted by putrye View Post
how can i write a shell script that takes a file path as command-line arguments.and it should report whether the path denotes a file or a directory.
thank youuu
You write a script by opening an editor, and typing.

If you mean you don't know what to put in it, you should begin by looking up scripting tutorials and/or your textbooks, since this sounds VERY much like a blatant homework assignment. There are thousands of bash scripting tutorials out there that can help you...did you try to look at any of them?
http://www.freeos.com/guides/lsst/
 
Old 12-14-2010, 01:31 PM   #3
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Also, please use descriptive thread titles in future, as you're asked to when posting here at LQ.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off




All times are GMT -5. The time now is 10:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration