Jump to content

Command won't run in script, but will run from command line


tr0910

Recommended Posts

The following commands work fine when issued from the command line, but when put into a script, they fail.  I've seen this before and don't understand what causes this.  Anybody have any idea?

 

 
umount /mnt/t3disk2
rmdir /mnt/t3disk2

 

Here is the script (t3unmount.sh) that fails

 

# Unmount connections to backup server tower3
# version .13
umount /mnt/t3disk1
umount /mnt/t3disk2
umount /mnt/t3disk2
umount /mnt/t3disk3
umount /mnt/t3disk4
umount /mnt/t3disk5
umount /mnt/t3disk6
rmdir /mnt/t3disk1
rmdir /mnt/t3disk2
rmdir /mnt/t3disk3
rmdir /mnt/t3disk4
rmdir /mnt/t3disk5
rmdir /mnt/t3disk6
echo mounts to t3 taken down

 

And here is what I get as response from bash:

 

root@Server1:/boot# t3unmount.sh

: not foundt/t3disk1

: not foundt/t3disk2

: not foundt/t3disk2

: not foundt/t3disk3

: not foundt/t3disk4

: not foundt/t3disk5

: not foundt/t3disk6

rmdir: failed to remove `/mnt/t3disk1\r': No such file or directory

rmdir: failed to remove `/mnt/t3disk2\r': No such file or directory

rmdir: failed to remove `/mnt/t3disk3\r': No such file or directory

rmdir: failed to remove `/mnt/t3disk4\r': No such file or directory

rmdir: failed to remove `/mnt/t3disk5\r': No such file or directory

rmdir: failed to remove `/mnt/t3disk6\r': No such file or directory

mounts to t3 taken down

 

(Running V5 RC8a)

Link to comment

The following commands work fine when issued from the command line, but when put into a script, they fail.  I've seen this before and don't understand what causes this.  Anybody have any idea?

 

 
umount /mnt/t3disk2
rmdir /mnt/t3disk2

 

Here is the script (t3unmount.sh) that fails

 

# Unmount connections to backup server tower3
# version .13
umount /mnt/t3disk1
umount /mnt/t3disk2
umount /mnt/t3disk2
umount /mnt/t3disk3
umount /mnt/t3disk4
umount /mnt/t3disk5
umount /mnt/t3disk6
rmdir /mnt/t3disk1
rmdir /mnt/t3disk2
rmdir /mnt/t3disk3
rmdir /mnt/t3disk4
rmdir /mnt/t3disk5
rmdir /mnt/t3disk6
echo mounts to t3 taken down

 

And here is what I get as response from bash:

 

root@Server1:/boot# t3unmount.sh

: not foundt/t3disk1

: not foundt/t3disk2

: not foundt/t3disk2

: not foundt/t3disk3

: not foundt/t3disk4

: not foundt/t3disk5

: not foundt/t3disk6

rmdir: failed to remove `/mnt/t3disk1\r': No such file or directory

rmdir: failed to remove `/mnt/t3disk2\r': No such file or directory

rmdir: failed to remove `/mnt/t3disk3\r': No such file or directory

rmdir: failed to remove `/mnt/t3disk4\r': No such file or directory

rmdir: failed to remove `/mnt/t3disk5\r': No such file or directory

rmdir: failed to remove `/mnt/t3disk6\r': No such file or directory

mounts to t3 taken down

 

(Running V5 RC8a)

See here in the FAQ:

http://lime-technology.com/wiki/index.php/FAQ#Why_do_my_scripts_have_problems_with_end-of-lines.3F

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...