LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-31-2006, 11:25 AM   #1
rsmccain
Member
 
Registered: Apr 2004
Location: Louisiana
Distribution: SUSE
Posts: 154

Rep: Reputation: 30
script that runs if file doesnt exist


im looking for a script toe accomplish the following

if /path/to/file = does not exist
then execute /opt/runthisscript

if /path/to/file = exists

exit.

-
sounds simple, but i know nothing about bash.

thanks.
 
Old 07-31-2006, 11:46 AM   #2
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Well, don't you really want to read 'man bash'?
if [ -f /etc/passwd ]; then echo ; else echo; fi;

<Looked at your threads. Well, don't you really think it's easier to read info bash once?>
 
Old 07-31-2006, 11:53 AM   #3
rsmccain
Member
 
Registered: Apr 2004
Location: Louisiana
Distribution: SUSE
Posts: 154

Original Poster
Rep: Reputation: 30
man bash

Quote:
Originally Posted by raskin
Well, don't you really want to read 'man bash'?
if [ -f /etc/passwd ]; then echo ; else echo; fi;

<Looked at your threads. Well, don't you really think it's easier to read info bash once?>
reading man bash is like japense algebra to me still.

thank you.
 
Old 07-31-2006, 01:49 PM   #4
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Well, don't despair. Try to read and understand it - it is not hard. Try t odo your best (it's important!). When you are finally stuck, ask someone. For example, here.
 
Old 07-31-2006, 01:59 PM   #5
rsmccain
Member
 
Registered: Apr 2004
Location: Louisiana
Distribution: SUSE
Posts: 154

Original Poster
Rep: Reputation: 30
...

Quote:
Originally Posted by raskin
Well, don't despair. Try to read and understand it - it is not hard. Try t odo your best (it's important!). When you are finally stuck, ask someone. For example, here.

thats what i did, and i appreciate your help.
 
Old 07-31-2006, 02:15 PM   #6
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
No, you asked how to do something, and I meant that you could ask how to understand something written in man bash.
 
Old 08-01-2006, 12:10 PM   #7
rsmccain
Member
 
Registered: Apr 2004
Location: Louisiana
Distribution: SUSE
Posts: 154

Original Poster
Rep: Reputation: 30
..

Quote:
Originally Posted by raskin
No, you asked how to do something, and I meant that you could ask how to understand something written in man bash.
i simply asked for help. don't think i didn't google around and try to figure it out on my own before posting.

quit being a jack*ss about it. i understand your my time isn't more valuable than yours, etc.. I GET IT.
 
Old 08-01-2006, 12:26 PM   #8
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
No, I don't say you should not ask questions like this! By the way, if everyone asks a question about something (s)he doesn't know and answers a question about something (s)he knows, everybody wins. I'm talking about different thing - you obviously try to use bash - it's good. You obviously try yo read documentation - it's also good. But you have problems understanding it. I know that such a problem is sometimes psychological. I recommend you to ask here not only for help about surface problem, but also for help about deeper problem. You seem to understand that I meant you would only ask for help about deeper problem - I don't mean so. By the way, some people say that Advanced Bash Scripting Guide is good. I cannot comment - I've read man bash first, info bash second and I'm too lazy to read something else of the same volume on the same topic.

P.S. Sorry if my tone in previous messages seemed rude.

Last edited by raskin; 08-01-2006 at 12:27 PM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
make.profile doesnt exist on stage 3 gentoo SciYro Linux - Distributions 2 06-12-2004 05:24 AM
/usr/src/linux doesnt exist? santasballz Linux - Newbie 7 02-08-2004 10:32 AM
MLDonkey_gui doesnt exist fedivh Linux - Software 34 02-07-2004 04:40 PM
mysql.sock doesnt exist radix Slackware 1 10-26-2003 06:11 AM
Directory /dev/floppy doesnt exist xprometeus Linux - Hardware 4 09-29-2003 06:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:52 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