LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-27-2011, 12:07 PM   #16
dchol
LQ Newbie
 
Registered: Jul 2011
Posts: 10

Original Poster
Rep: Reputation: Disabled

p.s. in case it helps anyone else who's come across this issue, below is a script that changes a file from (for example) "ASCII text, with CR line terminators" to just "ASCII test"

Code:
#!/bin/bash

# chng2ascii.sh
# if the text has only CR newlines, by converting all CR newlines to LF with
# more at https://secure.wikimedia.org/wikipedia/en/wiki/Newline

printf "What is the name of the inputfile? ->"

read inputfile

printf "What is the name of the outputfile? ->"

read outputfile

tr '\r' '\n' < $inputfile > $outputfile
 
Old 07-27-2011, 02:19 PM   #17
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,516

Rep: Reputation: 2893Reputation: 2893Reputation: 2893Reputation: 2893Reputation: 2893Reputation: 2893Reputation: 2893Reputation: 2893Reputation: 2893Reputation: 2893Reputation: 2893
Well in case you are interested, I did a little bid of poking around and below seems to do what you require:
Code:
#!/bin/bash

for full_url in $(< urls.txt)
do      

# remove the protocol
        url=${full_url#*//}
# extract the host
        host=${url%%/*}

        date=$(date +%s)

        wget -O "${host}${date}".png --user-agent="" "pdfmyurl.com?url=$url&--png&--page-size=A1&--redirect-delay=500"

done
This is based on the url file you showed previously.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] bash how pass array as one of several parameters to a function porphyry5 Programming 5 06-14-2011 09:11 PM
bash script for selecting a parameter from list of parameters m4rtin Programming 9 12-21-2009 09:41 AM
how to parse info from a txt file using c++ code abhisheknayak Programming 8 11-23-2007 01:33 AM
Pass Parameters to php from bash iman00b Linux - Newbie 2 09-09-2004 05:30 PM
lynx : read a list of URLs from file ? fnd Linux - Software 0 06-22-2004 04:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration