The & is a special character to the shell. The command is cut off at that point. So the shell takes everything before it as a command to run in the background.
And then afterwards will run the following command:
Which creates a variable named file with a value of filename1.gz intended for the environment of the command filename1.gz (which of course doesn't exist and so you get that command not found error).
To fix that mv command, quote any arguments with shell metacharacters. In your example, aside from the &, the ? is also special.
Quote:
Originally Posted by jacobs.smith
I have downloaded as suggested by Alister.
Don't blame this on me. I never suggested doing this. I merely mentioned that you could try using rename if you insisted on using wget -i. I suggested keeping it simple with scott's solution. I don't understand why you don't like that simple while-loop. Did you run it? If so, was it unacceptably slow? Did it give you an erroneous result?
I do love Scott's solution, but the point is after I get a bunch of those wget commands, I have to run them individually.
But, anyways I used the following command
And it works like a charm. Do you have a simple solution to do the above task in batch on all the files in the directory using rename? Because, I can't write the mv command for all those files in my directory. They are around 400 files. And the OSR number after acc= is varying. Can you suggest me something using sed and rename or sed and mv?
Thanks for ur time.
Last edited by jacobs.smith; 07-17-2012 at 11:22 AM..
Reason: forgot code tags
I do love Scott's solution, but the point is after I get a bunch of those wget commands, I have to run them individually.
Why manually? In your original post you stated that you had the list of urls in a file. Is that not the case? Are you not now using that file as an option-argument thusly:
Quote:
Originally Posted by jacobs.smith
I am using this command
If so, just use this instead (I took the liberty of adding -r and quotes to scott's code):
I did check my output files after editing the input.txt to the following
This input.txt has to be given to the
Quote:
wget -i
command.
I did that and all I see is a single output file instead of one. If all the 5 file sizes together is 10GB. I see a single file filename1.gz to be 10GB.
Hi ,
I'm trying to list the files and output is written to a file. But when I execute the command , the output file is being listed. How to exclude it ?
/tmp
file1.txt
file2.txt
ls -ltr |grep -v '-' | awk print {$9, $5} > output.txt
cat output.txt
file1.txt
file2.txt
output.txt (8 Replies)
I have a python script that gives output called test.png. By using the following command I run the script every 2 seconds. What is the easiest way to save the output as follows ( test.png (1st output), tes1.png (second output), tes2.png ....)
Command I i use
while sleep 2; do python... (1 Reply)
Hi,
I need to download a zip file from my the below US govt link.
https://www.sam.gov/SAMPortal/extractfiledownload?role=WW&version=SAM&filename=SAM_PUBLIC_MONTHLY_20160207.ZIP
I only have wget utility installed on the server.
When I use the below command, I am getting error 403... (2 Replies)
The below hides the messy commands of wget
#!/bin/bash
cd 'C:\Users\cmccabe\Desktop\wget'
wget -O getCSV.txt http://172.24.188.113/data/getCSV.csv
progressfilt ()
{
local flag=false c count cr=$'\r' nl=$'\n'
while IFS='' read -d '' -rn 1 c
do
if $flag
... (5 Replies)
Data files coming in different names in a file name called process.txt.
1. shipments_yyyymmdd.gz
2 Order_yyyymmdd.gz
3. Invoice_yyyymmdd.gz
4. globalorder_yyyymmdd.gz
The process needs to discard all the below files and only process two of the 4 file names available
... (1 Reply)
i use curl and wget quite often.
i set up alarms on their output. for instance, i would run a "wget" on a url and then search for certain strings within the output given by the "wget".
the problem is, i cant get the entire output or response of my wget/curl command to show up correctly in... (3 Replies)
Hi,
I'm trying to write a script to download RedHat's errata digest.
It comes in a txt.gz format, and i can get it easily with firefox.
HOWEVER: output is VERY strange when donwloading it in a script. It seems I'm getting a file of the same size - but partially text and partly binary! It... (5 Replies)
Sun Solaris Unix Question
Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain... (2 Replies)
Hi All
I want to download srs8.3.0.1.standard.linux24_EM64T.tar.gz file from the following website :
http://downloads.biowisdomsrs.com/srs83_dist/
But this website contains lots of zipped files
I want to download the above file only discarding other zipped files.
When I am trying the... (1 Reply)
Hello there,
İ want to ask a very simple question. I want to read the output messages of wget both in terminal and also put them into a text file.
i know that by using -o flag, i can log the messages into a text file but then i won't be able to see them on terminal.
I'd appreciate any help... (1 Reply)