{"id":449,"date":"2010-01-05T14:41:24","date_gmt":"2010-01-05T14:41:24","guid":{"rendered":"http:\/\/www.codingfriends.com\/?p=449"},"modified":"2010-01-05T14:46:55","modified_gmt":"2010-01-05T14:46:55","slug":"joining-program","status":"publish","type":"post","link":"https:\/\/www.codingfriends.com\/index.php\/2010\/01\/05\/joining-program\/","title":{"rendered":"Joining program"},"content":{"rendered":"<p>Since I was downloading a couple of files that needed to be joined together, I thought that I would write a bash script to do this for me.<\/p>\n<p>The file that I was getting was from a friend whom had created a home movie of his son walking but could not send the whole thing but had to send in parts, he used a program called <a href=\"http:\/\/www.freebyte.com\/hjsplit\/\">HJSplit<\/a>, but I wanted to join them together using just linux command line commands.  So after doing that I have done a small bash script that will do a similar task for me every-time without needing to type in a few commands.<\/p>\n<pre lang=\"bash\">\r\n#!\/bin\/bash\r\n# Ian Porter : http:\/\/www.codingfriends.com\r\n# joining program, that will join files together similar to hjsplit.\r\n\r\n# get the input values\r\ninput=$1\r\noutput=$2\r\n\r\n# if input is equal to 2 parameters then\r\nif [ $# -eq 2 ]\r\nthen\r\n        # ls all of the files that meet the requirements of the 1st parameter\r\n        for i in `ls $input*`;\r\n        do\r\n                echo \"Adding file $i to $output\"\r\n                cat $i >> $output\r\n        done\r\nelse\r\n        echo \"input filename(s) | output filename\"\r\n        echo \"...\"\r\n        echo \"example arv arv.avi\"\r\n        echo \"Please input the searchable filename and the output filename\"\r\nfi\r\n<\/pre>\n<p>If you save that as hj.sh and then change the execute writes on it<\/p>\n<pre lang=\"bash\">\r\nchmod 755 hj.sh\r\n<\/pre>\n<p>This will allow you to run the program without typing in sh <program name>, to use it for example just use<\/p>\n<pre lang=\"bash\">\r\n.\/hj.sh files_to_join big_file\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Since I was downloading a couple of files that needed to be joined together, I thought that I would write a bash script to do this for me. The file that I was getting was from a friend whom had created a home movie of his son walking but could not send the whole thing &hellip; <a href=\"https:\/\/www.codingfriends.com\/index.php\/2010\/01\/05\/joining-program\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Joining program<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48],"tags":[398],"class_list":["post-449","post","type-post","status-publish","format-standard","hentry","category-bash-linux","tag-linux"],"_links":{"self":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/449","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/comments?post=449"}],"version-history":[{"count":3,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/449\/revisions"}],"predecessor-version":[{"id":451,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/449\/revisions\/451"}],"wp:attachment":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/media?parent=449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/categories?post=449"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/tags?post=449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}