Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-10-2009, 02:09 PM   #1
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
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:

ls *_potHermannStillman*

before the for loop.

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

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
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:

#!/bin/bash -x


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

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

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


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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:49 PM.

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