Re: fedora-list Digest, Vol 25, Issue 118

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux