LinuxQuestions.org
Register a domain and help support LQ
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 08-10-2009, 02:09 PM   #1
KBriggs
Member
 
Registered: Jun 2009
Posts: 35

Rep: Reputation: 15
bash script file access question


Never mind, my mistake was a simple spelling error
thanks anyway

Last edited by KBriggs; 08-10-2009 at 02:35 PM.
 
Old 08-10-2009, 02:47 PM   #2
jvhiii
LQ Newbie
 
Registered: Aug 2007
Posts: 7

Rep: Reputation: 1
It's acting as though there are no directories that match the pattern *_potHermannSkillman* in the current working directory. I assume that you've already verified that these directories exist and the files you want to process are present. I suggest adding some debug code, like:

pwd
ls
ls *_potHermannStillman*

before the for loop.

-John
 
Old 08-10-2009, 02:54 PM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Using "#!/bin/bash -x" will probe useful the next time you run into a similar problem, it adds verbosity without having to insert debug echos everywhere in the middle of the script

Also, when dealing with paths and the like, you should really do some basic checks at least in your code. Like these:

Code:
#!/bin/bash -x

input="output"
output="output"
output_file="${output}/ibh_log_graph.dat"

if [ ! -d "$input" ]; then
        mkdir "$input";
fi

if [ ! -d "$output" ]; then
        mkdir "$input";
fi

if [ -f "${output_file}" ] && [ -w "${output_file}" ]; then
        rm -f "${output_file}"
fi
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
run bash script without shell access dexznrl Linux - Newbie 9 08-10-2009 01:46 PM
Bash script to access all files in a directory shinni Programming 5 04-24-2009 04:46 PM
Bash script for listing FTP usage as the file name of a file created in each share jojothedogboy Programming 1 12-05-2008 04:35 PM
LXer: Bash Script To Access Wikipedia LXer Syndicated Linux News 0 10-20-2008 03:00 AM
Bash script question J_Szucs Linux - General 4 05-29-2003 09:48 AM


All times are GMT -5. The time now is 09:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration