Ok, this is the first script I've ever attempted to write so go easy on me. I'm just trying to simple copy a tar.gz file from the directory the script is located to /usr/local/filename.tar.gz The script is run as root so it shouldn't be a permissions issue. (at least to my knowledge)
This is what it looks like
What happens is the following: $hadoop is never copied to the /usr/local directory and then after that the tar xzf is run in the current directory and it's extracted in the current directory. It is like bash is going through my script and just ignoring the text "/usr/local" I've tried all sorts of reading and quotation mixes. I generally hesitate to post questions in a forum because I like to learn it myself and most problems somebody has already posted, but this one truly has me stumped. I also added -v to the end of it to see whats happening. When I run the -v in the script the output is this
"`hadoop-1.0.3.tar.gz' -> `/usr/local/hadoop-1.0.3.tar.gz'"
(but it never copies the file)
When I run the -v from command prompt I get the same thing :
"`hadoop-1.0.3.tar.gz' -> `/usr/local/hadoop-1.0.3.tar.gz'" only it does copy the file. Any help is greatly appreciated.
Thanks, Joe
Last edited by Franklin52; 08-02-2012 at 08:18 AM..
Reason: Please use code tags for data and code samples
Hello all,
I have a file - 12.txt
cat 12.txt
===============================================
Number of executions = 2 Total execution time (sec.ms) = 0.009883
Number of executions = 8 Total execution time (sec.ms) = 0.001270
Number of... (23 Replies)
Trying to figure out why this works:
printpwd.pl
#!/usr/bin/perl
use CGI::Carp qw( fatalsToBrowser );
print "Content-type: text/html\n\n";
$A = system("pwd");
$A = `pwd`;
print "$A\n";
^^actually that works/breaks if that makes any sense.. i get the working directory twice but when... (5 Replies)
Hi all,
I have a piece of code which cork perfect. It copy the no of lines from some files (*.log) into finalLog file.
It read the lines after the line have text "ntot".
Here it is :
#!/bin/bash ... (10 Replies)
Hello,
I am facing a very strange problem when I run my script manuallu ./Fetchcode which is using to connect with MKS integrity from linux end it workks fine but when I run it from cron it doesn't work.Can someone help me
1) How could I check my script when it is running from cron like... (3 Replies)
Help. My script is working fine when executed manually but the cron seems not to catch up the command when registered.
The script is as follow:
#!/bin/sh
for file in file_1.txt file_2.txt file_3.txt
do
awk '{ print "0" }' $file > tmp.tmp
mv tmp.tmp $file
done
And the cron... (2 Replies)
Shell Scipt: temp.sh
su - <$username>
expect pass.exp
Expect script: pass.exp
#!/usr/bin/expect -f
# Login
#######################
expect "Password: " send "<$password>\r"
it comes up with Password: but doesnt take password passed throguh file. (2 Replies)
Hi All,
I am trying to calculate the total_amount based on two key fields. Here is the script. I am new to unix. So please help me to find out the error in this script.
I'm getting error like "command not found" and ]; is missing..
PRE_LBNO=0
PRE_DATE=0
TOT_PAY=0
for line in `cat... (4 Replies)
Hi i have write the one scripts and the scripts is error. The scripts purpose select one directory to check the file is there or not. i will give the two format of file to search the mention the path one file is there to select the file one copy the another location.please check the my script give... (1 Reply)
Hello experts,
we have input files with 700K lines each (one generated for every hour). and we need to convert them as below and move them to another directory once.
Sample INPUT:-
# cat test1
1559205600000,8474,NormalizedPortInfo,PctDiscards,0.0,Interface,BG-CTA-AX1.test.com,Vl111... (7 Replies)