Hi Don/Corona688 ,
Thanks a lot for your reply.As suggested by you ,after removing the carriage return from the script ,the script is working fine for me.As I am new to unix script level ,the script is not totally understandable to me.If you kindly explain the below block of code ,that will be really helpful for me.
I am not sure why shift is being used in the above code .And if DIR variable holds the value of "$1" ,then why the FILE variable is again holding the value of "$1".Kindy bear with me and if you please explain the above code block ,that will be really beneficial for my understanding.Thanks !
When you have working code and you don't understand what it does, the man pages on your system are always a good starting point. Since the shift utility is a shell built-in, it might have its own man page (man shift) or it might be described on the man page for your shell (man bash). I have reformatted your script and added comments. If the man pages and the following comments don't clear it up for you, please ask more detailed questions about the parts you don't understand...
If I was writing this code, I might use a simpler script:
Other than the hdfs utility that your script was using, this script only uses constructs required by the POSIX standards and the Single UNIX Specifications, so it should work with any shell that supports basic POSIX shell requirements (such as bash, ksh, ash, dash, zsh, and several others).
PS I forgot to mention that the above replacement does not add the unnumbered empty line to the end of the output files that the awk script produces. Do you really want/need to add an empty line to the output files?
Last edited by Don Cragun; 05-14-2015 at 12:22 AM..
Reason: Add PS.
I am learning Hadoop. As a part of that, Hdfs - Hadoop distributed file system has commands similar to unix where we can create,copy,move files from unix/linux file system to HDFS.
My question is
1) how two file systems (unix and hdfs) can coexist on thr same partition..
2)What if block... (1 Reply)
I am learning Hadoop. As a part of that, Hdfs - Hadoop distributed file system has commands similar to unix where we can create,copy,move files from unix/linux file system to HDFS.
My question is
1) how two file systems (unix and hdfs) can coexist on thr same partition..
2)What if block used... (0 Replies)
Hi All ,
I am facing one issue here...I have a huge file in hadoop file system.Some disk space issues are thr ,thatswhy I want to copy 1st 100 records from hdfs to local unix.I tried below command but it is no working .Its giving error like cat: Unable to write to output stream.if any one can... (2 Replies)
Hi All ,
I need a help regarding file ftp ing from mainframe to unix.Our source file is mainframe file.I need to download the mainframe file to local unix server through unix script.If anyone can help me how we can do it through unix script ,it will be really helpful.Thanks. (7 Replies)
Dear All,
i am trying to get the file from windows location to unix location without using FTP and neither thru entering the user id and password. I have one unix form which is running on web application and user is entering the location and file name there now i know the file name and path. So i... (8 Replies)
Dear Friends,
How to transfer files from my local PC to Unix directory without using FTP.
Scenario: Transfer/Upload a file from PC to unix using web browser without using FTP technologies. I heard something like sendunix and sendpc used to transfer files from unix to Desktop and... (1 Reply)
Hi All,
please help me to write a shell that ftp a file which is in the local (C:\) drive to a Unix server.
Where as i know the IP for the Unix server.
i could do this process by using ftp command.
pls help me to write as Shell script.
Thanks in advance for all of your answers.:b::b: (3 Replies)
Hi,
Which command I can use to download a file from website?
I tried with wget and lwp-dowload but no gain.
Can any one suggest me the good way to dowload? (2 Replies)
I am not sure, yet i want to learn.. therefor ..
I want to put some Unix on my machine.. Unix 03, nut i have heard its not free and not open source..
please advise me on what to do.. (4 Replies)