fedora-list Digest, Vol 25, Issue 118

Andrew Mather mathera at gmail.com
Mon Mar 13 11:34:06 UTC 2006


Hi,

: Bad interpreter: No such file or directory
>
> At the top, I have:
> #!/bin/bash
>
> I tried:
> #!/bin/sh
>
> But that got the same results. The permission bits are:
>
> -rwxr--r-- root root
>
> I'm running it as root.
>
> No probs, I have fixed that, just re-wrote it, and it seemed to work. I
> have
> another problem now though:



You didn't create the file in Notepad on a Windoze box did you ?  SOmetimes
Windoze puts odd (non-printing, so invisible) characters into text files.

You can generally fix that by running dos2unix on the file (dos2unix
myFile.txt)


Tar says it can't "stat" ls, says there's no such file or directory.
>
> here's the script:
>
> #!/bin/bash
>
> cd /var/ftp/backup;
>
> for file in ls
> do {
> tar cf /home/backup/$file.tar.tar $file/
> } done


Try:
for file in `ls .`
do {
tar cf /home/backup/$file.tar.tar $file/
} done

(note the backticks.  These cause the shell to execute the command and
capture the output)

Actually, the new 'politically correct' way to do this would be:

for file in $( ls . )
do {
tar cf /home/backup/$file.tar.tar $file/
} done

HTH


What is the problem?
>
> Cheers,
>
> Chris Norman
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20060313/e6a32721/attachment-0001.htm>


More information about the fedora-list mailing list