LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 11-14-2010, 05:17 PM   #1
xwishmasterx
Member
 
Registered: Jul 2008
Posts: 30

Rep: Reputation: 0
Question checking path to file


hello

I am trying to load a driver (xxx.ko) and uncertain if the path given is correct.

I do not have any direct access to my linux device, so I need a small script that will create a text file telling me if the file was found or not.

Is this simply? I am a complete linux-illiterate.
 
Old 11-14-2010, 05:29 PM   #2
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS7
Posts: 267

Rep: Reputation: 58
Code:
 [ -f /path-to-driver/xxx.ko ] && touch /path-to-telltalefile/telltale
creates a tell-tale file to indicate the driver file does exist
 
Old 11-14-2010, 05:32 PM   #3
xwishmasterx
Member
 
Registered: Jul 2008
Posts: 30

Original Poster
Rep: Reputation: 0
thanks for such a quick reply.

Now, what type of file do I create with this command? I mean how do I make sure this command is run?

I have to put the file on a flash stick so my device will read it on boot.

Do you need more info?
 
Old 11-14-2010, 05:42 PM   #4
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS7
Posts: 267

Rep: Reputation: 58
It will create an empty file at whatever you put in the the /path-to-telltalefile/telltale. It could possibly be in a ftp directory that you can read remotely.
 
Old 11-14-2010, 05:46 PM   #5
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS7
Posts: 267

Rep: Reputation: 58
If you want it to say something, you could replace the touch command with: echo "yes, it is there" >> /path-to-telltalefile/telltale
 
Old 11-14-2010, 05:51 PM   #6
xwishmasterx
Member
 
Registered: Jul 2008
Posts: 30

Original Poster
Rep: Reputation: 0
hmmm

I guess my idea wasn't as good as planned...

My problem is, I need to load the driver which are at the root of my flash stick, but I am unsure of the path.

Using the telltale, I cannot choose the path as I do not know where it will end up :/

Been trying to get this working for days...lol

Is there a way to have a file telling me its own path?
 
Old 11-14-2010, 05:54 PM   #7
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS7
Posts: 267

Rep: Reputation: 58
That'a a different question than I thought.. You'll have to see if someone else answers, sorry.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Move a file to some path and create that path when it doesn't exist WhisperiN Linux - Newbie 6 10-09-2010 11:47 AM
Any log file for checking file permission change history in RHEL 5.1? bilalcochin Linux - Newbie 3 04-02-2010 09:57 AM
Find a file path and directory path ak.lokesh Linux - Newbie 3 02-19-2009 12:37 PM
$PATH checking lfur Linux - General 8 01-05-2005 10:25 AM
Checking a file for numbers chrisk5527 Linux - General 1 09-12-2003 08:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:39 PM.

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
Open Source Consulting | Domain Registration