Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » Homework HelpRSS Feeds

Shell Script combine file in one file horizontally and vertically

Posted By: Zak Brown     Category: Unix / Linux / Ubuntu     Views: 10668

Write a Shell Script combine file in one file horizontally and vertically.

Code for Shell Script combine file in one file horizontally and vertically in Unix / Linux / Ubuntu

echo "enter choice to combine files:"
echo "1)verically"
echo "2)horizotally"

read ch
case $ch in
1) cat m1 > emp3
   cat m2 >> emp3;;
2) paste m1 m2 >> emp4;;
*) ;;
esac


OUTPUT
***********

[04mca58@LINTEL 04mca58]$ sh combine.sh
enter choice to combine files:
1)verically
2)horizotally
1
[04mca58@LINTEL 04mca58]$ cat emp3
thisis m1
thisis m2
[04mca58@LINTEL 04mca58]$ sh combine.sh
enter choice to combine files:
1)verically
2)horizotally
2
[04mca58@LINTEL 04mca58]$ cat emp4
thisis m1      thisis m2
  
Share: 



Zak Brown
Zak Brown author of Shell Script combine file in one file horizontally and vertically is from London, United Kingdom.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!