Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Script doesn't work, but commands inside work Post 302096134 by vino on Tuesday 14th of November 2006 05:57:43 AM
Old 11-14-2006
Quote:
Originally Posted by cheongww
Howdie everyone...

I have a shell script RemoveFiles.sh
Inside this file, it only has two commands as below:
rm -f ../../reportToday/temp/*
rm -f ../../report/*

My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it showed [Done]
But in the same directory that I executed the SCRIPT, I tried to execute the COMMANDs by themselves. They work!!! All files are removed accordingly.

Hopefully someone can help with this problem.

Many thanks in advance
In which directory did you execute this script ? The problem could be the relative path construct ../..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script doesn't work in another distribution

Hi everybody: I usually use Mandriva distro (in my laptop), and I have made some scripts. These scripts work correctly but now, in other computer which is installed Ubuntu don't work, and I have this error message: The script is: ..... echo "Your option is:" echo read option case... (1 Reply)
Discussion started by: tonet
1 Replies

2. Shell Programming and Scripting

gcd.sh script doesn't work...

Hi there. I'm new to scripting in bash shell and I have this problem. I'm trying to make a script that returns the greatest common divisor of two integer numbers according to Euclid's algorithm... Here is, what I've done: #!/bin/bash m=$1 n=$2 while do if ; #line 8 then m=$m-$n... (1 Reply)
Discussion started by: kantze
1 Replies

3. Shell Programming and Scripting

Help with script.. it Just doesn't work

Hello,, Im verry new to scripting and have some problems with this script i made.. What it does: It checks a directory for a new directory and then issues a couple of commands. checks sfv - not doing right now checks rar - it checks if theres a rar file and when there is it skips to... (1 Reply)
Discussion started by: atmosroll
1 Replies

4. Shell Programming and Scripting

two grep in one script doesn't work?

Hi there, the following script doesn't work. the first part works, then the second 'grep' fails with ': not found'. However, if I take out the second part (starting with the grep command) and put in a seperate script, it works. everyone know what's wrong here? no two 'grep' in one script, that... (2 Replies)
Discussion started by: monkey77
2 Replies

5. Shell Programming and Scripting

my script doesn't work :(

i have this script and when i ejecute it, the console tell me this " sintax error line 41 unexpected element "}" " is the sintaxis ok? #!/bin/bash if ;then { exit 0; } if ; then { sudo /etc/init.d/apache2 start; sudo /etc/init.d/mysql start; php5 & nautilus... (3 Replies)
Discussion started by: keiserx
3 Replies

6. Shell Programming and Scripting

Perl variables inside Net::Telnet::Cisco Module doesn't work

I am writing perl script to configure Cisco device but Variables inside Net::Telnet::Cisco Module doesn't work and passed to device without resolving. Please advise. here is a sample of script: use Net::Telnet::Cisco; $device = "10.14.199.1"; ($o1, $o2, $o3, $o4) = split(/\./,$device);... (5 Replies)
Discussion started by: ahmed_zaher
5 Replies

7. UNIX for Advanced & Expert Users

find -exec with 2 commands doesn't work (error incomplete staement)

Hi Gurues, I need to modify an existing script that uses find to search a folder, and then move its contents to a folder. What I need to do is run gzip on each file after it's moved. So, I ran this little test: Put a ls.tar file on my $HOME, mkdir tmp, and then: virtuo@tnpmprd01: find .... (3 Replies)
Discussion started by: llagos
3 Replies

8. Shell Programming and Scripting

[Solved] Script doesn't work..help?

hi, i am trying to run this script.the name of script is final.sh after i run it: #./final.sh & i grep the command # ps -a | grep bash and i see more then one processes runing 3!! Please use code tags how can i solve this problem? my target script must always run in... (8 Replies)
Discussion started by: zigizag
8 Replies

9. Shell Programming and Scripting

Switching user inside a shell script doesn't seem to work

Linux version : Oracle Linux 6.4 Shell : Bash The following script will be run as root. During the execution, it should switch to oracle user and execute few commands. After googling and searching within unix.com , I came up with the following syntax ## Enclosing all commands in double... (7 Replies)
Discussion started by: John K
7 Replies

10. UNIX for Beginners Questions & Answers

Saltstack commands inside bash scripts donā€™t work

In a Redhat Linux environment, I could run salt commands on the $ prompt but not inside my bash scripts. It will say command not found and the $PATH variable is exactly the same outside and inside the script. !#/usr/bin/bash echo “running”¯ salt "*" cmd.run ‘ls' exit Output:-... (8 Replies)
Discussion started by: gurudewa
8 Replies
rc3(8)							      System Manager's Manual							    rc3(8)

NAME
rc3 - Run command script executed when entering a multiuser run level SYNOPSIS
rc3 DESCRIPTION
The rc3 script contains run commands that enable initialization of the system to a multiuser state; run level 3. In addition to commands listed within the script itself, rc3 contains instructions to run certain commands found in the /sbin/rc3.d directory. The script defines the conditions under which the commands execute; some commands run if the system is booting, other commands execute if the system is chang- ing run levels. By convention, files in the rc3.d directory begin with either the letter "S" or the letter "K" and are followed by a two-digit number and a filename; for example: S00inet S55inetd S70mount S65lpd In general, the system starts commands that begin with the letter "S" and stops commands that begin with the letter "K." Commands that begin with the letter "K" run only when the system is changing run levels from a higher to a lower level. Commands that begin with the letter "S" run in all cases. The numbering of commands in the /sbin/rc3.d directory is important since the numbers are sorted and the com- mands are run in ascending order. Files in the /sbin/rc3.d directory are normally links to files in the /etc/init.d directory. An entry in the inittab file causes the system to execute the rc3 run commands, for example: s3:3:wait:/sbin/rc3 < /dev/console > /dev/con- sole 2>&1 The following operations are typical of those that result from executing the rc3 script and the commands located in the /sbin/rc3.d direc- tory. The operation depends on which state the system is entering or exiting. Setting the time zone Checking the current run level Start- ing network services and daemons Starting (or stopping) system services and daemons Mounting file systems Setting the TIMEZONE variable is one of the first operations completed by the rc3 script. This action provides the default time zone for subsequent commands. FILES
Specifies the command path Specifies the directory of commands that correspond to the run level RELATED INFORMATION
Commands: init(8), rc0(8), rc2(8) delim off rc3(8)
All times are GMT -4. The time now is 02:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy