[IELTS] Hobbies that require technology

Jake/English 2019. 6. 20. 00:03 Posted by JAKE_SLEEPY
IELTS Writing Task 2

(Question)
Some people prefer hobbies that require technology, while others do not. Discuss both views and give your opinion.


Planning:
1. prefer hobbies that require technology
(1) state-of-the-art technologies can be enjoyable for those who are eager to experience innovation.
(2) hobbies that can be challenging. technology is related to advanced knowledge. have benefits that we can learn about technology
2. prefer hobbies that do not require technology
(1) those who want to be relaxed from daily routine, less tension when learning something that is not concerned with technology.
(2) the level of difficulty is relatively low compared to hobbies with technology, have free access to hobbies.



There is a group of people who are fond of technology-requiring hobbies, whereas there are some who prefer traditional hobbies. Even though hobbies which do not need any technology have several benefits, I firmly believe that hobbies that demand high technologies are more preferable.

To begin with, there are several benefits that can be experienced when having conventional hobbies. Firstly, it is recommendable for those who want to be relaxed from daily routine. This is mainly due to the less tension when learning something that is not concerned to technological knowledge. In addition, hobbies with less theories can provide people with free access, since they are mostly not required to know complicated background knowledge, but substantially associated with daily life. For example, it is the dedication and interests that enable potted plants to be well-grown, not knowing any knowledge of high technology.

On the contrary, I believe that there are some notable advantages when people have technological hobbies. First and foremost, state-of-the-art technologies can be enjoyable for those who are eager to experience innovation. Thanks to this point, people are able to feel that they are residing in an advanced age, and keeping up with modern society. For instance, the promising and being on the rising technology of DNN, acronym of Deep Neural Network, is applied for makers whose hobbies are related to creating electronics based on their preferences. Moreover, hobbies that are concerned with challenging technologies can give opportunities to be utilized for workplaces, which increase possibilities to be excellent and creative in jobs.

In conclusion, although having hobbies demanding no technology can offer several benefits, I strongly believe that the adequacy of cutting-edge technology is sufficient for people to take advantages from it while living in a modern society.

[IELTS] Using social media on daily basis

Jake/English 2019. 6. 19. 23:53 Posted by JAKE_SLEEPY
IELTS Writing Task 2

(Question)
People are using social media on daily basis to keep in touch with others and for news updates.
Do you think the advantages outweigh the disadvantages?

Planning:
Advantages
  1. Can share news rapidly to numerous people in a convenient way.
  2. Not real friends no updates about them
  3. Sell something to
  4. Advertisement

Disadvantages
  1. Do not know whether the source is credible or not
  2. Wasting vast amount of time in using social media
  3. Superficiality, psychological problem, envious.


These days, social media is prevalent among people in order to get to know people’s life and learn about current affairs. I believe that the disadvantages are more significant than the advantages.

To begin with, there are several reasons why spending time on social media is unfavorable. First and foremost, the credibility of the source on social media is relatively at a lower level compared to the source on news from official broadcasting station. It is because all of people have free access to social media via Internet. In addition, not requiring any qualification but just registering an account allows users to write posts freely and share them rapidly even if the contents of them are false. For example, such as Facebook, one of the famous social media with open platform, that is being accessible to everyone,  does not demand reliability of information when users post it.

Secondly, it is commonly observed that the vast amount of time can be wasted by using social media. Obviously, a variety of entertainments are contained on social media mainly as a form of video, so that the possibility of spending time on videos is significantly high. From this reason, it impedes scheduled tasks like delaying the appointed time with an important person or skipping assignments, which results in inducing inefficient life. Last but not least, due to the fabulous experiences of friends, one can suffer self-pity about not having those activities in their life. From others’ superficial and envious experiences, people are vulnerable to have mental problems such as psychology of competition that people are striving to have better experience than others.

In conclusion, all things considered, I entirely believe that avoiding social media is recommendable as it deteriorates people’s quality of life and misleads them from inauthentic news sources.
IELTS Writing Task 2

(Question)
Government is going to provide free public transportation facilities 24/7 to reduce traffic congestion. To what extent do you agree or disagree?

Planning:
  1. Agree
1) improve
2)
  1. Disagree
1) eventually increase high density of people on transportation. Free of charge , indiscreetly use public transport. Extremely long line, waiting for free transport. Especially rush hour. Demand more public transportation.
2) afford lots of money on maintaining public transport. Hire more drivers, more sweepers, less usage at dawn. Spend lots of money for minorities.

It is said that the objective of reducing traffic congestion can be achieved if the government offers free of charge public transportation without holidays. I firmly disagree with the idea that providing free public transportation is necessary.

To begin with, I believe that there are two main reasons why unlimited public transportation is unfavorable. First and foremost, high density of people on transportation is inevitable when they operate public transportation freely. It is because people are willing to take public transportation without any hesitation. From that reason, especially in the rush hours, it leads to have extremely long lines for waiting free transports. So, the demand for public transportation will be increased to accommodate tremendous passengers.

On top of that, owing to the previous reason, governments should allocate a huge amount of budget on maintaining public transports. To give some examples, transportation companies, which are contracted by the government, should hire more drivers to provide citizens with all day long free services. Despite less usage of transportation at dawn, they spend the same amount of maintenance cost for minorities. This policy can be seen as providing excellent welfare system. However, this indiscreet use of public transportation results from government’s excessive spending of taxes to compensate the transportation companies compared to not providing the public with free transportation.

In conclusion, due to the vast amount of cost of upkeep for transportation facilities and inducing long waiting lines, I believe that the policy of free public transportation is undesirable.


'Jake > English' 카테고리의 다른 글

[IELTS] Hobbies that require technology  (0) 2019.06.20
[IELTS] Using social media on daily basis  (0) 2019.06.19
[IELTS] Free access to music and films online  (0) 2019.06.19
[IELTS] Paternity leave  (0) 2019.06.19
[IELTS] Living on their own  (0) 2019.06.19

[IELTS] Free access to music and films online

Jake/English 2019. 6. 19. 07:43 Posted by JAKE_SLEEPY
IELTS Writing Task 2

(Question)
Nowadays people have free access to music and films online. Is this positive or negative development? Provide relevant examples from your own experience.

Planning:
Positive
  1. More chances to experience various kinds of music and films. Give more options to customers/buyers. No need to visit store. (2)
  2. Provides opportunities to apply state of the art technology to content providing websites. Artificial Intelligent. Recommend music and films to customers by analyzing their trend of behavior in websites. Buy contents with iris recognition, fingerprint. Security transaction. (1)
  3. Blogs.. Write about the singer, actors. Evaluate their ability share ideas with numerous users. Comments. Websites for idols, singers, actors etc (3)
  4. Easy to search, well-categorized menus. Convenient. Various information at a glance. (4)

It is a fact that music and films are available freely via Internet. From my point of view, based on several reasons, I firmly believe that this development is beneficial.

To begin with, easy access to music and films can give opportunities to customers to apply state of the art technology to content-providing websites. For example, well-developed Artificial Intelligence technology is applied to websites in order to recommend music and films to customers by analyzing their trend of behavior in websites. To take another example, the technology of iris recognition and fingerprints is used to purchase contents as a way of secure transaction. Also, people are able to gain various and useful information at a glance by looking at a monitor. It is because, websites are neatly organized to search contents conveniently using well-categorized menus.

Moreover, the evaluation of artists’ abilities done by critics that are posted online, will help consumers decide whether or not to purchase music or films online.  More specifically, by using a method of sharing reviews on a certain artist, it is possible to affect customers’ behavior of buying. For instance, numerous writers write about singers and actors on their blogs, and blogging visitors leave comments on their posts to toss around opinions. Furthermore, there are more chances to experience diverse sorts of music and films when using them on the internet. It is favorable since customers will have more options to experience other music types and movies that they have never gone through.

In conclusion, the convenience for customers and the application of remarkable advancement of technology are the benefits of having the availability of music and films online.
(274)

(alternative)
In conclusion, the convenience for customers and the application of remarkable advancement of technology are the benefits of freely accessing music and films online.

'Jake > English' 카테고리의 다른 글

[IELTS] Using social media on daily basis  (0) 2019.06.19
[IELTS] Providing free public transportation facilities  (0) 2019.06.19
[IELTS] Paternity leave  (0) 2019.06.19
[IELTS] Living on their own  (0) 2019.06.19
[IELTS] Purpose of working hard  (0) 2019.06.19

[IELTS] Paternity leave

Jake/English 2019. 6. 19. 07:39 Posted by JAKE_SLEEPY
IELTS Writing Task 2

(Question)
All fathers should be entitled for a paternity leave when their child is born. What is your opinion on that?

It is said that after delivering a child from a mother, paternity leave is natural for every father. From my point of view, I firmly agree that all working fathers should be given the opportunity to spend time with their child and wife.

To begin with, it is not only mothers who should take care of their children but also fathers. It is because fathers also get involved in pregnancy. In other words, both parents automatically have obligations to raise their offsprings equally. In addition, the support of a husband can be necessary for a wife before and after a child is born. This is because there are numerous things like household chores that mothers cannot do during that period that fathers can take over.

Moreover, fathers can have an emotional attachment that mothers cannot provide. For example, in general, fathers are likely to possess tough character and this provides an emotional security to development of a child. Meanwhile, as mandated by law, companies are required to provide working fathers with paternity leave in order to spend time with their child and wife. In Korea, the government encourages working fathers who work in private and public organizations to take the opportunity to leave from work temporarily during the neonatal stage of their child. Through these reasons, the society is giving importance to the obligations of a father towards his wife and child.

In conclusion, It is a must for fathers to get paternity leave to be able to take part in the development of a child.

++ (Reference)
Planning
Paternity leave
Reasons.
1. Not only mother but also father should take care of children since they give birth to babies, they automatically have a duty, obligation to raise them
2. Father can have a variety of effects that mother cannot
3. neonatal period is significant period for babies to be adapted to the new environment
4. Can support wife, assist household chores
5. Emotional attachment
However, nurturing children is not an issue of weighing the importance between mothers and fathers, so
The maternity leave is commonly mentioned since mothers are the actual people who bear children. However, fathers
Last but not least, neonatal period is a significant period for babies to be adapted to the new environment.

[IELTS] Living on their own

Jake/English 2019. 6. 19. 07:39 Posted by JAKE_SLEEPY
IELTS Writing Task 2

(Question)
In many societies, more and more people are choosing to live on their own.
What are the reasons behind this? Is it a positive or negative trend?

Planning
Live alone.
Reasons :
1. Don’t want to get disturbed. Cozy atmosphere
2. Reluctant to expose one’s privacy. Privacy Infringement, don’t want to show their real characteristic, their habits, without roommates.
3. Enjoy their life less constraints for traveling to foreign countries, less spending, less preparation,

Why positive trend?
1.  They can consider themselves as being important and independent. They can invest themselves. Don’t have to sacrifice for others.
2.  Can arouse government's attention on their policy
3. Can improve the ability of being independent.

(Introduction)
It is a global tendency that the number of people who decide to reside by themselves is increasing. This phenomenon is primarily due to gaining freedom, and I regard this as being optimistic.

(Body 1)
To begin with, there are two reasons why people are fond of living independently(apart from their family). First and foremost, people do not allow others to invade their own privacy. This is because people are reluctant to reveal their real lifestyles, habits, and characteristics when dwelling with other people. Secondly, people merely do not want to get disturbed, which requires a comfortable atmosphere. More specifically, If a house accommodates more than two people, it is highly possible that the house will be filled with tons of noise, owing to vigorous communication.

(Body 2)
I consider this as positive because people can become responsible. Living on their own makes them learn how to budget their own money and manage to do household chores. For example, if they have a tight budget, they will learn how to spend their money in a wise way like buying the things that are just necessary for them. Moreover, this constructive tendency can arouse government’s awareness on fertility policies. Due to the skyrocketing cost of living, people are not willing to get married and give birth to babies, so governments can look back on current fertility policies.

(Conclusion)
In conclusion, since people are eager to enjoy their lives single-handed, and protect their own privacy, the given phenomenon is considerably persuasive.



++(Alternative Introduction)
Nowadays, the number of people who live independently is increasing across the globe. This phenomenon is due to attaining freedom and I think this is a favorable trend.

'Jake > English' 카테고리의 다른 글

[IELTS] Free access to music and films online  (0) 2019.06.19
[IELTS] Paternity leave  (0) 2019.06.19
[IELTS] Purpose of working hard  (0) 2019.06.19
[IELTS] Problems while living in big cities  (0) 2019.06.19
[IELTS] Studying or getting a job  (0) 2019.06.19

[IELTS] Purpose of working hard

Jake/English 2019. 6. 19. 07:38 Posted by JAKE_SLEEPY
IELTS Writing Task 2

(Question)
Some people think that the only purpose of working hard is to earn money. To what extent do you agree or disagree with this opinion?

planning:
agree or disagree :
agree : 1. financial reward can be useful in people’s livelihood -  capitalism
           2. able to have more opportunities that money plays an important role in - education, better career, money for surgery, investment
disagree:

(Introduction)
It is believed that earning a lot of money is a motivation for people to work hard. I agree with this idea.

(Body 1)
To begin with, it is obvious that financial reward is useful in maintaining people’s livelihood. This is because most of the global societies consist of capitalism, which result in obsession with money. In fact, it is needless to say that there is no possibility in that people can live without spending some amount of money in daily life. For instance, aside from the homeless, it is inevitable that cost of maintenance will be charged after using services that are essential for people’s lives such as electricity, water, internet bill, and the like. To take another example, paying taxes is mandatory to people in order for the governments to sustain as a result people need money.

(Body 2)
Moreover, I believe that people are able to have more opportunities whenever they have money. Due to the inability of affording advanced education, there is a tendency that the implication of widening income gap can be seen in the society. For example, pursuing Masters degree in Business Analysis will cost tons of money, but once people succeed in it, their salaries will be guaranteed to be doubled or tripled. Furthermore, sizeable wealth should be needed in case of medical surgery or investing to promising assets like real estate. As long as people are affluent with money, it is no bad thing to be prepared well for the unexpected situations. (As long as people are financially-secured, there is no worry about some unexpected situations that they might encounter. )

(Conclusion)
In conclusion, I firmly agree that wealth is one of the most essential components for making a living and that provides numerous chances to attain a convenient life.

'Jake > English' 카테고리의 다른 글

[IELTS] Paternity leave  (0) 2019.06.19
[IELTS] Living on their own  (0) 2019.06.19
[IELTS] Problems while living in big cities  (0) 2019.06.19
[IELTS] Studying or getting a job  (0) 2019.06.19
Memory strategy  (0) 2019.05.28

[IELTS] Problems while living in big cities

Jake/English 2019. 6. 19. 07:36 Posted by JAKE_SLEEPY
IELTS Writing Task 2

(Question)
Many people around the world are choosing to move to live in cities. What problems do people experience in big cities? Should governments encourage people to move to smaller towns?

Planning:
Problems:
-confusion of using transportation; ex. Not knowing which line they should take
-air pollution - too many cars; emit gas
-crowded
-traffic congestion - tardiness in going to work
Solutions of Gov’t:
*transfer to rural area
-gov’t subsidy - tax cuts
-gov’t provide housing to city people to transfer in rural areas
-enhancing the transportation system in rural places

(Introduction)
It is undeniable that the number of people who prefers to reside in metropolitan areas is significantly increasing.There are critical problems that affect the quality of life to city people, I think it is just right for the government to recommend those people to transfer in rural places.

(Body 1)
To begin with, the confusion of using transportation can be expected while people are living in metropolitan residences. For instance, when people need to go [to] somewhere, they have too numerous options that it might makes them to decide their transportations in a complicated way. Moreover, the implication of the excessive number of vehicles is air pollution that can result in making people’s quality of life devastated. Furthermore, heavy traffic congestion can negatively affects the time of commuting to workplaces. This makes people’s valuable time wasted on the roads, which also has adverse influence on their daily life and productivity.

In order to resolve those problems, following solutions should be helpful in that they are realistic and feasible for governments. First and foremost, the method of granting subsidies such as tax cuts can be possible so that people are willing to reside in small scale cities. Secondly, providing housing to city people to transfer to the provinces is possible to be considered in that those who are planning to transfer to new areas are mainly concerned about their financial condition. It will change people’s perception on the plan optimistically. The Last but not least, the transportation system in rural places should be enhanced, which enables people to go to metropolis in a convenient way.

Notes:
The third sentence is too long and it is beating around the bush. Please make it straight to the point.

(Conclusion)
In conclusion, since residing in metropolis causes several issues that negatively affects people’s overall quality of life, the governments should immediately take actions in order to solve the problems.


RED - delete/omit
ORANGE - add the word
DARK GREEN - edit


'Jake > English' 카테고리의 다른 글

[IELTS] Living on their own  (0) 2019.06.19
[IELTS] Purpose of working hard  (0) 2019.06.19
[IELTS] Studying or getting a job  (0) 2019.06.19
Memory strategy  (0) 2019.05.28
The power of small successes  (0) 2019.05.27

[IELTS] Studying or getting a job

Jake/English 2019. 6. 19. 07:17 Posted by JAKE_SLEEPY
IELTS Writing Task 2

(Question)
Some people believe that studying at university or college is the best route to a successful career, while others believe that it is better to get a job straight after school.
Discuss both views and give your opinion.

(Introduction)
A group of people believe that the optimal method of achieving successful careers is to study at university, others think that getting a job immediately is more favorable. While there are benefits of getting a job right after secondary school, I strongly support the idea of studying in tertiary.

(Body 1)
To begin with, getting a job at an early age compared to university students makes it possible to start social life faster. This can result in advancing the date of either achieving stable lives or marriage. Secondly, people who start work right after graduation from high school can plan their own life in 20s freely unlike pursuing a stereotyped life. It means that they are allowed to design their lives more flexibly. Lastly, encountering some challenges related to their life plans makes them matured in making a right decision.

(Body 2)
On the other hand, I believe that students can have opportunities to learn their academic fields of interest intensively by entering universities. Unlike education in secondary schools, professors who are accredited and fully knowledgeable in academic fields help students learn in-depth comprehension of their majors. In addition, students have the chance to gain priceless experiences from a variety of programs such as internship which prepares them to work in the real workplace. Furthermore, the possibility of getting high salaries can be expected, since students graduated from universities or colleges are considered professionals.

(Conclusion)
In conclusion, although it is advantageous to work right after finishing secondary schools, I believe that the benefits of getting a job subsequent to graduation from universities are promising.


'Jake > English' 카테고리의 다른 글

[IELTS] Living on their own  (0) 2019.06.19
[IELTS] Purpose of working hard  (0) 2019.06.19
[IELTS] Problems while living in big cities  (0) 2019.06.19
Memory strategy  (0) 2019.05.28
The power of small successes  (0) 2019.05.27

딥러닝 시작하기

Developer/DNN 2019. 6. 19. 02:36 Posted by JAKE_SLEEPY

<준비물>

Python 3
numpy (math)
matplotlib (graph)




Anaconda 설치 (Ubuntu 16.04 LTS)


Linux 클릭 -> python 3.7 version Download


Save File 선택 후 OK


$ bash ~/Downloads/Anaconda3-2019.03-Linux-x86_64.sh


ENTER


yes



설치가 끝나고 conda 명령어 사용을 위해 .bashrc 어쩌고 하는게 있었는데
딴짓하다보니 지나가버렸다 :(

conda 명령이 적용되지 않아서 ... 찾아보았다.

$ source ~/anaconda3/bin/activate
$ conda init

터미널 창을 보니 .bashrc를 수정했다고 한다.

터미널을 껐다가 다시 켰다.
(base) 라는 문구가 앞에 붙게된다.


$ conda config --set auto_activate_base False
$ source ~/.bashrc

이후 (base) 가 사라졌다...!

알고보니 (base) 라는게 anaconda 환경이 활성화되었다는 표시였다.



$ source ~/anaconda3/bin/activate

비활성화시킬려면

$ conda deactivate




anaconda 실행하기

$ anaconda-navigator


'Developer > DNN' 카테고리의 다른 글

Visual Studio Code 설치 (ubuntu)  (0) 2019.10.06
Anaconda 환경 관리  (0) 2019.10.05

쉘 스크립트 작성(5)

Developer/Linux 2019. 6. 18. 23:49 Posted by JAKE_SLEEPY

For 문

for var in list
do
        command set
done

list 의 값들이 차례대로 하나씩 var에 대입된다.

1st    iteration : var = list[0]
2nd  iteration : var = list[1]
3rd   iteration : var = list[2]
                ...
Nth iteration : var = list[N-1]

list의 모든 element를 참조할 때까지 계속 실행된다.


[목록에서 값을 읽기]

스크립트


결과


[목록에 추가]

스크립트


마치 string을 결합하는 느낌이 든다.
str + str !


결과



'Developer > Linux' 카테고리의 다른 글

윈도우에서 Ubuntu Bootable USB 만들기  (0) 2019.06.30
쉘 스크립트 작성(4)  (0) 2019.06.18
쉘 스크립트 작성(3)  (0) 2019.06.16
쉘 스크립트 작성(2)  (0) 2019.06.16
쉘 스크립트 작성  (0) 2019.06.16

SiFive 행사

Caool 2019. 6. 18. 20:00 Posted by 컴파일무럭

2019-06-18

금일 SiFive 한국 국내 행사 진행하여 참석 진행하였습니다. 

장소는 판교 한국반도체산업협회에서 진행했습니다. 

내용은 SiFive에서 진행하는 제품 프로모션을 진행하였고, SiFive와 협력하는 기업들의 자사 제품 promotion을 진행했다. 

IP Vendor, RISC-V Debug Solution 제품등을 소개하는 자리였다. 

아래는 식사 내용입니다. 샌드위치라서 산뜻하고 맛있네요 ^^ 


'Caool' 카테고리의 다른 글

반성문  (0) 2019.06.18
posix_spawn이란?  (0) 2019.06.16

반성문

Caool 2019. 6. 18. 19:35 Posted by 컴파일무럭

오늘 잘못했습니다.

괜한 걱정 및 냉정하지 않는 생각으로 제 선임에게 혼났습니다.

전 아직 어려서 안 되는 것 같습니다.

제 글 읽어주시는 분들은 저와 같은 상태가 되지 말길 바랍니다...

ㅠㅠㅠㅠ 

'Caool' 카테고리의 다른 글

SiFive 행사  (0) 2019.06.18
posix_spawn이란?  (0) 2019.06.16

쉘 스크립트 작성(4)

Developer/Linux 2019. 6. 18. 01:51 Posted by JAKE_SLEEPY

복수 조건

[ condition 1 ] && [ condition 2 ]
: condition 1 과 condition 2가 모두 TRUE 일때

[ condition 1 ]  | |   [ condition 2 ]
: condition 1 이 TRUE 이거나 condition 2가 TRUE 일때


스크립트


결과



이중 괄호

(( expression ))

expression 에는 수식이나 비교 표현식이 들어갈 수 있다.


!
논리 부정
~
비트 부정
**
지수화
<<
비트 왼쪽 쉬프트
>>
비트 오른쪽 쉬프트
&
비트 단위 AND
|
비트 단위 OR
&&
논리 AND
||
논리 OR
num++
후위증가
num--
후위감소
++num
전위증가
--num
전위감소

스크립트



(( expression )) 에서는 > 기호가 리다이렉트가 아닌 부등호로 인식된다.


결과





이중 대괄호

문자열 비교에 사용한다.

스크립트


결과





'Developer > Linux' 카테고리의 다른 글

윈도우에서 Ubuntu Bootable USB 만들기  (0) 2019.06.30
쉘 스크립트 작성(5)  (0) 2019.06.18
쉘 스크립트 작성(3)  (0) 2019.06.16
쉘 스크립트 작성(2)  (0) 2019.06.16
쉘 스크립트 작성  (0) 2019.06.16

posix_spawn이란?

Caool 2019. 6. 16. 23:19 Posted by 컴파일무럭

POSIX_SPAWN은 Linux POSIX에서 제공하는 exec함수의 일종이다. 

기본적으로 리눅스는 프로그램을 실행할 때, 우선 Child Process를 fork한 다음 exec함수를 사용하여 프로그램을 수행한다. 주로 컴퓨터 공학 시스템 프로그래밍을 공부하면 알게 되는 내용이다. 

대학생이라면 이와 같은 내용이 대다수가 알게 되는 내용이다. 하지만 LLVM LINUX System 함수들을 보다보니 fork, exec 패턴이 아니라 posix_spawn 방식으로 프로그램을 실행하는 모습을 보았다. 물론 이는 기존에 알고 있는 System call fork, exec 기능을 온전히 따르는 것이다. 

아직 내용을 더 파악해야 하지만, 현재 분석한 내용은 이와 같다. 아래 링크를 참고하여 세부적인 사항을 알아보자

http://man7.org/linux/man-pages/man3/posix_spawn.3.html

하지만 은근히 이를 까는 리눅스 커널 개발자들도 여럿 있는 것으로 보인다. 

https://lwn.net/Articles/360747/


'Caool' 카테고리의 다른 글

SiFive 행사  (0) 2019.06.18
반성문  (0) 2019.06.18

쉘 스크립트 작성(3)

Developer/Linux 2019. 6. 16. 20:04 Posted by JAKE_SLEEPY
조건 실행

if [ condition ]
then
    command set
fi

대괄호 앞 뒤에는 한칸 띄어져 있어야 한다.

대괄호 안에는 조건을 적는다.

condition 에는 숫자 비교, 문자열 비교, 파일 비교를 통해 조건 생성



숫자 비교
비교식
기능
num1 -eq num2
num1 과 num2가 같은지 확인한다.
num1 -ne num2
num1 과 num2가 다른지 확인한다.
num1 -ge num2
num1이 num2 보다 크거나 같은지 확인한다.
num1 -gt num2
num1이 num2보다 큰지 확인한다.
num1 -le num2
num1이 num2보다 작거나 같은지 확인한다.
num1 -lt num2
num1이 num2보다 작은지 확인한다.
#!/bin/bash

val_1=45
val_2=36

if [ $val_1 -lt 50 ]
then
    echo "value 1 is less than 50"
else
    echo "value 2 is greater than or equal to 50"
fi

if [ $val_1 -eq $val_2 ]
then
    echo "value 1 is equal to value 2"
else
    echo "value 1 is not equal to value 2"
fi


결과







문자열 비교

비교식
기능
str1 = str2
str1이 str2와 같은지 확인한다.
str1 != str2
str1이 str2와 다른지 확인한다.
str1 < str2
str1이 str2보다 작은지 확인한다.
str1 > str2
str1이 str2보다 큰지 확인한다.
-n str
str의 길이가 0보다 큰지 확인한다.
-z str
str의 길이가 0인지 확인한다.

[ 두 문자열이 일치하는지 확인 ]




결과






[ 두 문자열의 크기 비교 ]


결과


banana??

실행 오류의 원인: 

    부등호 기호를 이스케이프 하지 않아서 리다이렉트 기호로 해석해버렸기 때문.


수정

    


결과

    




[ 데이터 존재 유무 확인 ]


결과






파일 비교

비교식
기능
-d file
파일이 존재하며, 파일의 종류가 디렉토리인가?
-e file
파일이 존재하는가? (파일 종류는 상관X)
-f file
파일이 존재하고 정규 파일(Regular file)인가?
-r file
파일이 존재하며, 읽을 수 있는가?
-s file
파일이 존재하며, 비어 있지 않은가?
-w file
파일이 존재하며, 기록할 수 있는가?
-x file
파일이 존재하며, 실행할 수 있는가?
-O file
파일이 존재하며, 현재 사용자가 소유했는가?
-G file
파일이 존재하며, 기본 그룹이 현재 사용자와 같은가?
file_1 -nt file_2
file_1이 file_2보다 새것인가?
file_1 -ot file_2
file_1이 file_2보다 오래되었나?


A regular file is a file that is not a directory, symlink, socket, device, etc.

[ -e  FILE ] :   /etc/hosts = TRUE , /dev/null = TRUE
[ -f  FILE ] :   /etc/hosts =  TRUE, /dev/null  = FALSE


[ 디렉토리가 존재하는지 확인한 후에 디렉토리 위치 변경]


결과


[ 파일이 존재하면 현재 날짜와 시간을 그 파일에 추가 ]




결과








 



'Developer > Linux' 카테고리의 다른 글

쉘 스크립트 작성(5)  (0) 2019.06.18
쉘 스크립트 작성(4)  (0) 2019.06.18
쉘 스크립트 작성(2)  (0) 2019.06.16
쉘 스크립트 작성  (0) 2019.06.16
쉘 스크립트 파일 만들기  (0) 2019.06.09

쉘 스크립트 작성(2)

Developer/Linux 2019. 6. 16. 16:26 Posted by JAKE_SLEEPY
명령 실행

if-then 구문 사용


if command
then
    command set
fi


if문은 그 줄에 정의된 명령을 실행한다. 

이때 명령이 제대로 실행이 되었다면 반환값은 0이다.

하지만, 명령이 제대로 실행되어지지 않았다면 반환값은 0이 아닌 수이다.




#!/bin/bash

if mkdir my_dir
then
    echo "my directory is created! 1"
    echo "my directory is created! 2"
    echo "my directory is created! 3"
fi



if-then-else 구문 사용


if command
then
    command set 1
else
    command set 2
fi

#!/bin/bash

if mkdir my_dir
then
    echo "my directory is created! 1"
    echo "my directory is created! 2"
    echo "my directory is created! 3"
else
    ls
    echo "my directory is already created!"
fi


if-then-elif 구문 사용


if command 1
then
    command set 1
elif command 2
then
    command set 2
else
    command set 3
fi



elif 문을 쓰면 바로 뒤에 나오는 else 문은 앞에 나온 if-then 구문 코드 블록에 속한 것이 아닌 elif 문에 속한 것!

즉, elif에 대한 else를 의미.


if command1
then
    command set 1
elif command2
then
    command set 2
elif command3
then
    command set 3
elif command4
then
    command set 4
fi



'Developer > Linux' 카테고리의 다른 글

쉘 스크립트 작성(4)  (0) 2019.06.18
쉘 스크립트 작성(3)  (0) 2019.06.16
쉘 스크립트 작성  (0) 2019.06.16
쉘 스크립트 파일 만들기  (0) 2019.06.09
변수 배열  (0) 2019.06.09

쉘 스크립트 작성

Developer/Linux 2019. 6. 16. 16:26 Posted by JAKE_SLEEPY

사용자 변수



쉘 스크립트 안에서 쓸 수 있는 변수를 선언할 수 있다.
변수를 선언함으로써 데이터를 저장하여 사용할 수 있고, 프로그래밍에 가까워 질 수 있다.

변수명=변수값

var=7
var_str="It is my string"

변수형은 쉘에서 자동으로 결정한다.

그리고 변수의 생명주기는 쉘 스크립트가 실행되어 끝날 때까지다.




명령 치환



명령의 결과를 변수에 저장할 수 있다.

#!/bin/bash

echo "hello world!"
test_0=$(ls)
test_1=$(date)

echo $test_0
echo $test_1

$()를 사용하여 명령의 결과값을 얻을 수 있다.

소괄호 안에는 반드시 명령어가 들어가야 한다.

변수명을 적을시 Command not found 라고 뜰 것이다.

왜냐하면 명령어를 적지 않고 변수명을 적었으니 정의된 명령어가 아니므로 에러를 출력할 것이기 때문이다.

ls 명령의 결과를 test_0 변수에 저장하고

date 명령의 결과를 test_1 변수에 저장한다.






활용예) 시뮬레이션 결과를 날짜별로 관리하기

#!/bin/bash

sim_time=$(date +%y%m%d.%H%M%S)
mkdir sim_$sim_time






출력 리다이렉트


이전 포스트에 간략히 설명하였다.


출력 리다이렉트는 명령의 출력을 받아서 파일로 전송한다.

기본 출력 리다이렉트 형식은 다음과 같다.

command > outputfile


기존의 내용에 출력 결과를 추가하고 싶다면

command >> outputfile







입력 리다이렉트


입력 리다이렉트는 출력 리다이렉트와는 반대로, 

파일의 내용을 받아서 명령으로 보내준다.

command < inputfile


다른 점이 하나 있다면 << 부호는 인라인 입력 리다이렉트라는 기호다.

파일 대신 터미널로 입력 리다이렉트를 할 데이터를 지정할 수 있다.

command << marker
data 0
data 1
data 2
...
marker

시작과 끝의 marker 는 동일해야 한다.


wc 명령은 데이터의 줄, 단어, 바이트의 수를 출력한다.

총 3줄, 15개의 단어,
4(띄어쓰기)+19(글자)+1(NULL)+
4(띄어쓰기)+20(글자)+1(NULL)+
4(띄어쓰기)+19(글자)+1(NULL) = 73 바이트





'Developer > Linux' 카테고리의 다른 글

쉘 스크립트 작성(3)  (0) 2019.06.16
쉘 스크립트 작성(2)  (0) 2019.06.16
쉘 스크립트 파일 만들기  (0) 2019.06.09
변수 배열  (0) 2019.06.09
PATH 환경 변수  (0) 2019.06.09

Python syntax error

Developer/Misc 2019. 6. 16. 10:11 Posted by JAKE_SLEEPY
Symptom:

    SyntaxError: Non-ASCII character '\xc0' in file




Solution:

Use UTF-8 encoding


    In a script file, put # -*- coding: utf-8 -*-           at the second line


    ex) 1.           #!/usr/bin/python2.7
        2.           # -*- coding: utf8 -*-

'Developer > Misc' 카테고리의 다른 글

System Folder Name change from Korean to English  (0) 2019.08.23
gvim warning produced when closing gvim  (0) 2019.06.16

gvim warning produced when closing gvim

Developer/Misc 2019. 6. 16. 09:50 Posted by JAKE_SLEEPY
Symptom:

(gvim:17446): GLib-GObject-WARNING **: cannot retrieve class for invalid (unclassed) type '<invalid>'











Solution: 
                        


vim-gnome and vim-gtk must be uninstalled


                        $ sudo apt-get remove vim-gnome
                        $ sudo apt-get remove vim-gtk



vim-gtk3 needs to be installed


                        $ sudo apt-get install vim-gtk3


'Developer > Misc' 카테고리의 다른 글

System Folder Name change from Korean to English  (0) 2019.08.23
Python syntax error  (0) 2019.06.16

쉘 스크립트 파일 만들기

Developer/Linux 2019. 6. 9. 15:45 Posted by JAKE_SLEEPY

쉘 명령어를 스크립트 파일에다 작성한다.

왜 파일에다 작성해야 할까?

장점
  1. 반복적인 일련의 명령을 매번 입력하지 않아도 된다.
  2. 업무에서의 생산성 증가
  3. 재사용의 용이 (파일 단위이므로)

단점
  1. 스크립트 작성에 익숙하지 않은 사람은 건드릴 수 없다.
  2. 재작성할 기회가 적어지므로 스크립트 작성 능력이 떨어질 수 있다.





개인적인 생각을 정리해보았다.

결국 스크립트를 지겹도록 작성하는 사람에겐 단점이라는 건 있을 수 없겠다.

업무의 생산성을 향상시키기 위해선 쉘 스크립트를 작성하여 자동화시키는 것이

이윤 추구를 위해선 당연한 것처럼 보인다.






쉘 스크립트가 실행되도록 설정해야 할 것들

1.#!{쉘 지정}
2.PATH 환경 변수 설정
3.chmod u+x {스크립트 파일} (실행권한 부여)

쉘 스크립트를 만들 때, 가장 첫 번째 줄에서 쉘에게 해당 스크립트를 실행할 쉘을 지정해줄 수 있다.

다른 쉘에서 실행시킬 수 있다. 예를 들면 bash에서 csh로 스크립트를 실행하는 경우가 있겠다.

#기호는 주석처리할 때 사용하지만, 첫줄에 #!를 표시하고 그 뒤에 사용할 쉘의 위치를 알려준다.

#!/bin/bash #!/bin/csh

참고로, #!/bin/csh -f 라는 걸 볼 수 있는데 여기서 -f 옵션은 Fast start로써 .cshrc나 .login 파일을 읽지 않고 실행한다고 한다.

PATH 환경 변수 포스트에 위의 과정이 있으니 참고하도록 하자.










'Developer > Linux' 카테고리의 다른 글

쉘 스크립트 작성(2)  (0) 2019.06.16
쉘 스크립트 작성  (0) 2019.06.16
변수 배열  (0) 2019.06.09
PATH 환경 변수  (0) 2019.06.09
사용자 정의 변수 선언  (0) 2019.06.07

변수 배열

Developer/Linux 2019. 6. 9. 02:52 Posted by JAKE_SLEEPY
환경 변수를 배열로 선언할 수 있다.



변수명=(원소0 원소1 원소2 ...)


myvar_arr 변수가 a,b,c,d,e,f 를 원소로 가지도록 선언하였다.

값을 참조하면 index가 0 인 값이 출력된다.




원하는 index의 값을 참조하고 싶을 경우

{변수명[index]} 형식을 사용한다.





모든 index의 원소를 전부 출력하고 싶을 경우 index 자리에 *(asterisk)를 넣는다.



특정 index의 원소를 없애고 싶다면 unset 명령을 이용한다.




'Developer > Linux' 카테고리의 다른 글

쉘 스크립트 작성  (0) 2019.06.16
쉘 스크립트 파일 만들기  (0) 2019.06.09
PATH 환경 변수  (0) 2019.06.09
사용자 정의 변수 선언  (0) 2019.06.07
환경 변수  (0) 2019.06.07

PATH 환경 변수

Developer/Linux 2019. 6. 9. 01:00 Posted by JAKE_SLEEPY


명령을 쉘에 입력하면 쉘은 그 명령을 찾으려고 할 것이다.

이때 이 명령이 어디에 있는 지 알려주는 기능을 하는 것이 PATH 환경 변수다.

그래서 PATH에 해당 쉘 명령이 없다면 쉘은 명령을 실행할 수 없다.



gvim mytest

mytest의 코드는 ~/에 다음과 같이 작성하였다.


#!/bin/bash
echo "hello world!"





bash에 puts 명령이 있을 줄 알았는데 없었다.

그래서 echo 명령을 사용했다. 

chmod +x mytest  명령으로 실행가능하게 만들고

./mytest

실행하여서 hello world! 라고 터미널에 출력된다.




~/Music 디렉토리에서 실행을 하였는데 명령을 찾지 못했다고 한다.

그래서 PATH 환경 변수에 mytest가 있는 디렉토리 위치를 추가하였더니

mytest를 실행할 수 있었다.


'Developer > Linux' 카테고리의 다른 글

쉘 스크립트 파일 만들기  (0) 2019.06.09
변수 배열  (0) 2019.06.09
사용자 정의 변수 선언  (0) 2019.06.07
환경 변수  (0) 2019.06.07
코프로세싱  (0) 2019.06.06

사용자 정의 변수 선언

Developer/Linux 2019. 6. 7. 21:10 Posted by JAKE_SLEEPY
사용자 정의 지역 변수 선언하기


변수이름=변수값



서브 쉘을 생성하고 이전 쉘에서 선언한 변수를 참조했더니

참조할 수 없었다.

왜냐하면 지역 변수를 선언 했기 때문에.




사용자 정의 전역 변수 선언하기

전역 환경 변수를 만들기 위해서는 먼저 지역 변수를 생성하고 이를 전역 환경으로 내보내면 된다.

export {지역 변수명}



서브 쉘을 생성하는 쉘을 부모 쉘이라고 하고 생성된 쉘을 자식 쉘이라고 한다면

지역 변수는 부모 쉘에서 선언한 변수가 자식 쉘에서는 참조될 수 없었지만,

전역 변수는 부모 쉘에서 선언한 변수가 자식 쉘에서도 참조될 수 있다.






변수 제거하기

unset {변수명}





'Developer > Linux' 카테고리의 다른 글

변수 배열  (0) 2019.06.09
PATH 환경 변수  (0) 2019.06.09
환경 변수  (0) 2019.06.07
코프로세싱  (0) 2019.06.06
백그라운드  (0) 2019.06.06

환경 변수

Developer/Linux 2019. 6. 7. 01:43 Posted by JAKE_SLEEPY


환경 변수는 쉘 세션과 작업 환경에 대한 정보를 저장하기 위해 사용된다.
 
환경 변수를 이용해 메모리에 데이터를 저장할 수 있기 때문에 쉘에서 실행 중인 모든 프로그램이나 스크립트를 쉽게 사용할 수 있다.
 
 
환경 변수에는 전역 변수와 지역 변수가 있다.
전역 변수는 어디에서든 참조하여 쓸 수 있지만, 지역 변수는 생성한 쉘에서만 사용할 수 있다.
그렇기 때문에 생성한 쉘이 종료되면 지역 변수도 사라지게 될 것이다.


printenv 명령을 통해 전역 환경 변수를 출력해보았다.


리눅스 시스템에 상당히 많은 전역 환경 변수들이 선언되어 있는 것을 알 수 있다.

이러한 시스템 환경 변수는 일반 환경 변수와 구별되기 위해서 대문자로만 선언한다.





환경 변수를 참조하려면 환경 변수 이름 앞에 $ 기호를 넣어야 한다.





참조한 변수를 다양하게 활용할 수 있다.









'Developer > Linux' 카테고리의 다른 글

PATH 환경 변수  (0) 2019.06.09
사용자 정의 변수 선언  (0) 2019.06.07
코프로세싱  (0) 2019.06.06
백그라운드  (0) 2019.06.06
서브 쉘(2)  (0) 2019.06.06

코프로세싱

Developer/Linux 2019. 6. 6. 21:08 Posted by JAKE_SLEEPY

코프로세싱

 

코프로세싱(Co-processing)은 두 가지 작업을 동시에 수행하는 것을 뜻하며, 

백그라운드에서 서브 쉘을 생성하고 서브 쉘에서 명령을 실행한다.

coproc {서브쉘에서 실행할 명령} 

 

coproc 두번 실행했더니 Warning이 떴는데, 실행은 된다.

 

서브 쉘에서 명령을 실행한다고 해서 ps --forest 로 확인을 해봤더니 서브 쉘에서 실행하지 않고 있는데,

 

어떻게 된 것일까?

내가 서브 쉘을 생성해주어야 서브 쉘에서 실행을 하는 걸까?

 

 

coproc 명령을 백그라운드로 보내도 차이가 없다.

 

 

'Developer > Linux' 카테고리의 다른 글

사용자 정의 변수 선언  (0) 2019.06.07
환경 변수  (0) 2019.06.07
백그라운드  (0) 2019.06.06
서브 쉘(2)  (0) 2019.06.06
서브 쉘  (0) 2019.06.05

백그라운드

Developer/Linux 2019. 6. 6. 16:53 Posted by JAKE_SLEEPY

백그라운드에 명령을 실행하면 명령이 처리되는 동안에도 자유롭게 터미널을 다른 일에 쓸 수 있다.

 

백그라운드에서 명령이 실행되도록 하려면 마지막에 & 문자를 붙인다.

 

백그라운드에 명령을 실행하면 프로세스에 대한 정보를 제공하는데, 

대괄호 안의 숫자에 백그라운드 프로세스 번호를 알려주고

그 프로세스의 ID (PID)를 알려준다.

 

 

 

 

백그라운드에서 명령을 실행시킨 후 jobs 명령을 사용하면 현재 백그라운드에서 실행되고 있는

프로세스 목록을 출력하는데, 백그라운드 프로세스 번호, 상태 그리고 명령을 출력한다.

 

 

프로세스가 동작 중일때에는 Running이라고 나타나며, 프로세스가 끝나면 Done이라고 표시한다.

jobs 명령에 -l 옵션을 추가하면 PID가 추가로 출력된다.

 

 

쉘 안에서 많은 양의 작업들을 수행해야 할 경우에 백그라운드로 명령을 실행하면 터미널을 계속 사용할 수 있기 때문에

좀 더 터미널의 사용에 유연해질 수 있다.



터미널을 여러개 띄우는 것보다 백그라운드에서 작업을 하는게 나 개인적으로는 편했다.

'Developer > Linux' 카테고리의 다른 글

환경 변수  (0) 2019.06.07
코프로세싱  (0) 2019.06.06
서브 쉘(2)  (0) 2019.06.06
서브 쉘  (0) 2019.06.05
  (0) 2019.06.05

서브 쉘(2)

Developer/Linux 2019. 6. 6. 01:12 Posted by JAKE_SLEEPY

한 줄에 일련의 명령들을 입력하여 순차적으로 실행하는 방법이 있다.

 

각 명령들 사이에 세미콜론(;)을 넣어주면 연속적으로 명령들을 실행할 수 있다.

 

 

이러한 방식은 명령을 실행하기 위해서 서브 쉘을 생성하지 않는다.

 

그 근거는 BASH_SUBSHELL 변수의 값이 0이라는 것에서 알 수 있다.

 

 

 

 

괄호를 사용해서 명령을 그룹화하는 방법이 있다고 한다.

 

이러한 방식은 명령을 실행하기 위해서 서브 쉘을 생성한다.

 

 

그룹화된 명령 안에 또 다른 그룹화된 명령이 들어갈 수도 있다.

 

그리고 괄호 쌍의 갯수만큼 서브 쉘을 생성한다.

 

 

 

 

 

서브 쉘을 쓰고 안 쓰고가 큰 차이가 있는지 잘 모르겠다.

 

그 이유를 좀 더 알아볼 필요가 있어보인다.

'Developer > Linux' 카테고리의 다른 글

코프로세싱  (0) 2019.06.06
백그라운드  (0) 2019.06.06
서브 쉘  (0) 2019.06.05
  (0) 2019.06.05
파이프 그리고 리다이렉트  (0) 2019.06.01

서브 쉘

Developer/Linux 2019. 6. 5. 22:37 Posted by JAKE_SLEEPY

서브 쉘 생성

 

 

쉘 이름을 터미널에 입력하면 서브 쉘이 생성된다.

 

 

 

 

첫번째 쉘(PID 1775)에서 파생된 두 번째 쉘(PID 2100)의 PPID가 첫 번째 쉘의 PID와 일치하는 것으로 보아 

두 번째 쉘은 첫 번째 쉘에서 파생된 서브 쉘이라는 것을 알 수 있다.

 

 

세 번째 쉘의 PPID는 2100이며, 이는 두 번째 쉘의 PID와 일치한다.

 

 

네 번째 쉘의 PPID는 2109이며, 이는 세 번째 쉘의 PID와 일치한다.

 

 

 

 

 

ps --forest 명령은 서브 쉘들이 어떻게 가지를 쳤는지 보여준다.

 

 

 

 

exit 명령을 통해 서브 쉘에서 빠져나갈 수 있다.

 

 

 

참고로 쉘 스크립트를 실행하면 서브 쉘이 생성된다.

'Developer > Linux' 카테고리의 다른 글

백그라운드  (0) 2019.06.06
서브 쉘(2)  (0) 2019.06.06
  (0) 2019.06.05
파이프 그리고 리다이렉트  (0) 2019.06.01
링크 파일  (0) 2019.05.31

Developer/Linux 2019. 6. 5. 01:48 Posted by JAKE_SLEEPY

쉘(SHELL)은 무엇일까?

 

 

이름 그 자체를 생각해보았을 때 무엇인가를 외부 요인으로부터 보호하기 위해 둘러싼 껍질이라는 게 떠올랐다.

 

껍질이 있으면 알맹이를 보는 게 어렵다.

 

그리고... 껍질은 외부와 알맹이 사이에 존재한다.

 

이것을 리눅스 커널과 사용자의 개념에 적용해본다면

 

쉘은 사용자(외부)로부터 커널(알맹이)를 보호하는 역할을 함과 동시에 둘 사이에 존재해서 상호작용을 할 수 있도록

 

만들어 주는 역할, 즉 사용자가 명령을 하면 그것을 커널에게 전달해주는 역할을 하는 것이 아닐까?

 

 

 

나의 기본 쉘 확인하기

 

나는 어떤 쉘을 쓰고 있는걸까?

 

/etc/passwd 파일에는 모든 사용자 계정 목록과 각 계정의 기본 쉘들이 지정되어 있다.

 

내가 쓰는 쉘을 알고 싶기 때문에

 

cat /etc/passwd | grep jseok

 

bash로 나의 기본 쉘이 지정되어 있는 것을 확인할 수 있다.

 

 

 

나의 기본 쉘 바꾸기

 

 

chsh 명령을 통해 bash를 csh로 기본 쉘을 바꾸어 보자.

 

 

 

Restart 후에 현재 쉘을 확인하면 /bin/csh로 바뀌었다.

 

 

'Developer > Linux' 카테고리의 다른 글

서브 쉘(2)  (0) 2019.06.06
서브 쉘  (0) 2019.06.05
파이프 그리고 리다이렉트  (0) 2019.06.01
링크 파일  (0) 2019.05.31
압축하고 풀기  (0) 2019.05.31