Understand Linux Shell and Basic Shell Scripting Language Tips-Part I

高效阅读嵌入式源码系列二:understand阅读linux、uboot等源码 当使用understand分析linux、uboot这类大型工程时,会因为无关源文件太多导致静态分析时卡死。故,如何精准地导入linux、uboot源码到understand,是值得探索的。如何精准地获取源码文件,主要使用tonyho大神的Generate_Kernel_Uboot_Project_forIDE工具,生成linux/uboot等源码所必须的源文件,导入到understand软件中便于精准分析。......... 阅读详情

Picture speak more than words and the below picture says all about the working of Linux.

 

Understanding Linux Shell

Understanding Linux Shell

Read Also

  1. 5 Shell Scripts to Learn Shell Programming – Part II
  2. Sailing Through The World of Linux BASH Scripting – Part III

Understanding Linux Shell

  1. Shell: A Command-Line Interpretor that connects a user to Operating System and allows to execute the commands or by creating text script.
  2. Process: Any task that a user run in the system is called a process. A process is little more complex than just a task.
  3. File: It resides on hard disk (hdd) and contains data owned by a user.
  4. X-windows aka windows: A mode of Linux where screen (monitor) can be split in small “parts” called windows, that allow a user to do several things at the same time and/or switch from one task to another easily and view graphics in a nice way.
  5. Text terminal: A monitor that has only the capability of displaying text stuff, no graphics or a very basic graphics display.
  6. Session: Time between logging on and logging out of the system.

Types of Shell on a Standard Linux Distribution

Bourne shell : The Bourne shell was one of the major shells used in early versions and became a de facto standard. It was written by Stephen Bourne at Bell Labs. Every Unix-like system has at least one shell compatible with the Bourne shell. The Bourne shell program name is “sh” and it is typically located in the file system hierarchy at /bin/sh.

C shell: The C shell was developed by Bill Joy for the Berkeley Software Distribution. Its syntax is modelled after the C programming language. It is used primarily for interactive terminal use, but less frequently for scripting and operating system control. C shell has many interactive commands.

Beginning the Fun! (Linux Shell)

There exist thousands of commands for command-line user, how about remembering all of them? Hmmm! Simply you can not. The real power of computer is to ease the ease your work, you need to automate the process and hence you need scripts.

Scripts are collections of commands, stored in a file. The shell can read this file and act on the commands as if they were typed at the keyboard. The shell also provides a variety of useful programming features to make scripts truly powerful.

Basics of Shell Programming

  1. To get a Linux shell, you need to start a terminal.
  2. To see what shell you have, run: echo $SHELL.
  3. In Linux, the dollar sign ($) stands for a shell variable.
  4. The ‘echo‘ command just returns whatever you type in.
  5. The pipeline instruction (|) comes to rescue, when chaining several commands.
  6. Linux commands have their own syntax, Linux won’t forgive you whatsoever is the mistakes. If you get a command wrong, you won’t flunk or damage anything, but it won’t work.
  7. #!/bin/sh – It is called shebang. It is written at the top of a shell script and it passes the instruction to the program /bin/sh.

About shell Script

Shell script is just a simple text file with “.sh” extension, having executable permission.

Process of writing and executing a script
  1. Open terminal.
  2. Navigate to the place where you want to create script using ‘cd‘ command.
  3. Cd (enter) [This will bring the prompt at Your home Directory].
  4. touch hello.sh (Here we named the script as hello, remember the ‘.sh‘ extension is compulsory).
  5. vi hello.sh (nano hello.sh) [You can use your favourite editor, to edit the script].
  6. chmod 744 hello.sh (making the script executable).
  7. sh hello.sh or ./hello.sh (running the script)
Writing your First Script
#!/bin/bash
# My first script

echo "Hello World!"

Save the above lines on a text file, make it executable and run it, as described above.

Sample Output
Hello World!

In the above code.

#!/bin/bash (is the shebang.)
# My first script (is comment, anything following '#' is a comment)
echo “Hello World!” (is the main part of this script)
Writing your Second Script

OK time to move to the next script. This script will tell you, your’s “username” and list the running processes.

#! /bin/bash
echo "Hello $USER"
echo "Hey i am" $USER "and will be telling you about the current processes"
echo "Running processes List"
ps

Create a file with above codes, save it to anything you want, but with extension “.sh“, make it executable and run it, from you terminal.

Sample Output
Hello tecmint
Hey i am tecmint and will be telling you about the current processes
Running processes List
  PID TTY          TIME CMD
 1111 pts/0    00:00:00 bash
 1287 pts/0    00:00:00 sh
 1288 pts/0    00:00:00 ps

Was this cool? Writing script is as simple as getting an idea and writing pipelined commands. There are some restrictions, too. Shell scripts are excellent for concise filesystem operations and scripting the combination of existing functionality in filters and command line tools via pipes.

When your needs are greater – whether in functionality, robustness, performance,efficiency etc – then you can move to a more full-featured language.

If you already know C/Perl/Python programming language or any other programming language, learning the scripting language won’t be much difficult.

Writing your Third Script

Moving to, write our third and last script for this article. This script acts as an interactive script. Why don’t you, yourself execute this simple yet interactive script and tell us how you felt.

#! /bin/bash
echo "Hey what's Your First Name?";
read a;
echo "welcome Mr./Mrs. $a, would you like to tell us, Your Last Name";
read b;
echo "Thanks Mr./Mrs. $a $b for telling us your name";
echo "*******************"
echo "Mr./Mrs. $b, it's time to say you good bye"
Sample Output
Hey what's Your First Name?
Avishek
welcome Mr./Mrs. Avishek, would you like to tell us, Your Last Name
Kumar
Thanks Mr./Mrs. Avishek Kumar for telling us your name
******************************************************
Mr./Mrs. Kumar, it's time to say you good bye

Well this is not an end. We tried to bring a taste of scripting to you. In our future article we will elaborate this scripting language topic, rather a never ending scripting language topic, to be more perfect. Your valuable thoughts in comments is highly appreciated, Like and share us and help us to spread. Till then just chill, keep connected, stay tuned.

linux下understand5.1安装 linux understand5.1 阅读详情

相关推荐

深入解析Linux环境下的Understand工具应用

Understand是一个强大的代码分析工具,广泛应用于IT行业中的软件开发者和质量保证团队。它支持多种编程语言,并提供了深入的代码审查、度量和理解功能,帮助用户提升软件质量、维护性和复杂度的管理。为了确保Understand在运行时拥有最佳性能,可能需要对软件进行一些性能调整。这包括内存分配、缓存大小以及并发处理能力等设置。这些选项大多可以在软件的”Preferences”设置中找到,并进行相应调整。需要注意的是,过度配置可能会导致系统资源消耗过大,因此应根据实际机器的性能来进行权衡选择。

weixin_34413326的博客 1143

代码分析工具Understand第一章:介绍

本章介绍Understand软件。阅读优秀的开源源码可以有效提升我们的编程能力、编程思想、架构。但是由于开源项目非常复杂,一个项目中会有大量的函数、类的相互调用,错综复杂。由于这些原因使得我们难以着手,没有思路、方法。因此面对这种情况我们需要一款工具软件,来帮助我们去进行代码的分析,帮助我们来进行阅读学习项目代码。在比较早期的时候,source insight 这款代码分析工具已经相当优秀,不过最近接触了另一款工具叫做Understand,发现了这款宝藏工具,因此写这篇文章来进行分享,介绍给大家。

m0_57700068的博客 9725

Understand-5.0.967-Linux-64bit.tgz

Understand-5.0.967-Linux-64bit.tgz 看代码的工具,好像最新版本的都得沟通获取了,为了方便大家,就放这里了。

linux understand 安装 及 使用

step 1: 添加路径。gedit ~/.bashrc,在最后加上 export PATH=$PATH:~/scitools/bin/linux32 (文件解压后的路径) step 2: 在文件解压后的路径,终端输入 cd bin/linux64/ ./understand step 3: 然后输入证书验证码,09E58CD1FB79 这样就能顺利的运行understand了。 ...

zhangfenger的博客 7382

源码阅读工具Understand-3.1-Linux-64bit,源码安装包,使用手册,注册号

源码阅读工具Understand-3.1-Linux-64bit,源码安装包,使用手册,注册号

代码分析工具 understand 5 Linux 64

下载地址 https://scitools.com/download/all-builds/ 大家可以自己取下载

工具Cursor(一)介绍&简单使用&特色

下载安装后使用google账户登录。使用代码库索引后:✅ AI 回答更准确,因为它能基于当前项目的索引库回答问题✅ 文件搜索更快✅ AI 能更好地理解跨文件的关系✅ 重构建议更精准实际效果对比使用代码库索引和不使用代码库索引的主要区别:使用代码库索引时,AI 先搜索了项目中的文件,然后根据文件内容回答AI 能准确指出项目中实现的具体功能和代码不使用代码库索引时,AI 只能从一般角度回答,没有针对项目的具体情况什么是 AI 规则?AI 规则是 Cursor 的一个功能。

w_t_y_y的博客 2734

Understand-6.1.1091-Linux-64bit.tgz

最新Understand-6.1.1091-Linux-64bit

人工智能学习心得(4): 使用OpenCode测试模型,分析POST请求

OpenCode工作目录与使用建议,模型/APIKey配置,抓包分析显示发送“你是谁?”消耗7727 tokens是因为OpenCode自动附加的系统提示词与标题生成任务,最后总结temperature、top_p、top_k参数区别。OpenCode需在专用空目录运行以防误删文件

zhangcoder的博客 记录学习轨迹~ 232

Understand_4.0.923-Linux-64bit.7z

Understand 比Source Insight 更好用的工具,linux版本,带证书码; 源代码阅读工具(Scientific Toolworks Understand)的特色 1、支持多语言:Ada, C, C++, C#, Java, FORTRAN, Delphi, Jovial, and PL/M ,混合语言的project也支持 2、多平台: Windows/Linux/Solaris/HP-UX/IRIX/MAC OS X 3、代码语法高亮、代码折迭、交叉跳转、书签等基本阅读功能。 4、可以对整个project的architecture、metrics进行分析并输出报表。

.NET MAUI跨平台串口通讯方案

MAUI跨平台串口通信架构设计采用分层模式,核心是共享业务逻辑层与平台特定实现。通过定义统一的ISerialPortService接口,实现了Windows、Android、iOS和macOS四大平台的串口通信功能。Windows平台使用System.IO.Ports类库,Android通过USB Host模式实现,iOS基于ExternalAccessory框架,macOS则采用IOKit。该设计支持串口连接管理、数据收发等核心功能,并通过事件机制实现异步通信。架构采用条件编译区分各平台实现,确保代码复用

冰茶的博客 1673

Linux 平台源代码阅读器understand

Windows平台上,source insight是阅读源代码最佳工具之一,然而到了Linux平台上,很难找到与之抗衡的工具,有人说用VIM+Ctags+CScope,不过还是不太爽!找到了一款跨平台的源代码阅读工具understand,该工具基于QT开发(基本上Linux上GUI软件都是用Qt开发,当然也有很少一部分用的GTK开发)。解压缩之后直接将所有文件拷贝到/opt目录下,在/usr/sh

sunjunior的专栏 5540

【各种轮子2】基于Icepak的PCB散热仿真比较

随着电子产品的集成度越来越高,PCB板的尺寸越来越小,板级芯片散热的问题越来越成为电子工程师的一个重要挑战。对于板级芯片散热,主要依靠工程师对PCB自身的设计进行优化,同时要兼顾系统的尺寸和成本。本文分别从芯片角度和PCB角度进行建模,芯片模型选用QFN封装,PCB模型采用走线导入模型,探讨了芯片结构,PCB铜厚,PCB叠层厚度对芯片散热的影响。

3681

Linux下阅读代码工具----understand

下载官网:https://scitools.com/download/archive/ 安装指南:https://scitools.com/documents/unix_install.php 解压:tar -xvzf Understand-*-.tgz 把解压出来的understand可执行文件添加到环境变量: echo “export PATH=$PATH:/home/myname/s...

飞呀飞呀菲 3844

从QEvent到系统响应:EC如何成为硬件事件的隐形信使

本文深入解析嵌入式控制器(EC)如何作为硬件事件的隐形信使,通过QEvent机制将按键、合盖等物理事件转换为SCI信号,并经由ACPI架构触发操作系统响应。EC与BIOS紧密协作,实现了从底层硬件到系统层面的高效事件传递,是嵌入式开发和系统优化的关键技术。

yellow的专栏 655

PX4算法解析:L1制导律

一、前沿 从今天开始,会陆续为大家解读开源飞控软件px4中使用到的各种算法,今天要讲述的是L1制导律,这是固定翼飞机进行路径跟踪的重要算法之一。这个算法是由MIT的研究人员提出,因为具有比较好的路径跟踪效果而得到广泛应用。在这之前,无人机在进行路径跟踪时一般采用基于侧偏距的PD控制器方法,至于为什么使用PD而不使用PID算法,那是因为位置环响应较慢,所以一般在外环采用PD算法,而在内环采用PID算...

weixin_44616080的博客 8265

Linxu 下安装 Understand 教程

第一步,从此处下载压缩包(也可直接去understandguan)。

leungtung 3191

半导体设备隔振必看:如何用天棚阻尼PID控制实现VC-C级振动抑制(含SIMULINK模型)

本文深入探讨了在半导体精密制造中,如何运用天棚阻尼PID控制算法实现VC-C级振动抑制。通过构建高保真单自由度仿真模型,详细解析了从算法原理、SIMULINK实现到参数整定的全链路方案,并针对谐波扰动提供了陷波滤波器设计方法,为工程师提供了从仿真到实践的完整主动隔振技术指南。

pz89012345的博客 548

linux下,代码阅读工具,understand

https://scitools.com/download/archive/安装指南http://www.xuebuyuan.com/1489041.html官方Linux版本安装指南Installation InstructionsUncompress and extract the contents of the installation file. For example: % tar...

XIANG 4817

抖音 X-Gorgon 加密算法逆向与 Python 爬虫实战(2026 最新版)

抖音(TikTok 国内版)作为日活超 8 亿的超级 App,其反爬体系在国内互联网中属于顶级难度。核心签名参数X-Gorgon和X-Khronos是几乎所有业务接口(视频详情、评论、搜索、用户主页)的“通行证”。没有正确的 Gorgon 签名,服务器直接返回403或。市面上的教程大多停留在2023 年之前的 V4 版本,而抖音在 2025 年底全面升级到了V6 协议,算法结构、加密常数、混淆方式全部重构。

2201_76125261的博客 380

彻底解析 DDIC_TYPE_INCONSISTENCY:从 ABAP ST22 连环 Dump 到 SE14 一键修复

听上去像内核级的致命故障,实则更多源于日常运维的细枝末节。只要掌握的排查三板斧,结合严格的变更流程与周期性的字典体检,再严重的 Dump 也能化险为夷。希望本文的案例与步骤能帮助读者在下一次遇到类似问题时,既能快速止血,也能追根溯源,避免重蹈覆辙。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 638

Understand 5.1.1029 版本 Linux 64位安装包

Understand 5.1.1029 版本 Linux 64位安装包 去发现同类优质开源项目:https://gitcode.com/ 这里是Understand 5.1.1029版本的Linux 64位安装包资源下载。此安装包适用于Linux环境下,能够帮助用户更加便捷地安装Understand工具,进而进行代码阅读、分析和维护。 Understand工具是一款强大的代码理解工具,支持多种编程...

gitblog_06734的博客 384

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

探索代码世界的高效利器:Understand 5.1.1029版本Linux64位安装包

探索代码世界的高效利器:Understand 5.1.1029版本Linux64位安装包 去发现同类优质开源项目:https://gitcode.com/ 项目介绍 在代码开发的海洋中,理解和管理大型代码库常常是一项挑战。今天,我们为您推荐一款强大的代码理解工具——Understand 5.1.1029版本Linux64位安装包。此安装包为Linux环境下用户提供了一个便捷的安装方式,让开发者能够...

gitblog_06787的博客 972

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

linux 源代码分析工具,linux下的源代码分析工具understand 2014100328681022

F1AF6D901A3819878CBBFB13B0F234CE4366Treemaps are an area-based visualization where the size and color of the area are visually representing a metric. This Understand feature allows the user to choose ...

weixin_36048947的博客 291

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

understand linux 64,Understand-4.0.877-Linux-64bit.tgz最新版本2017年源代码阅读利器,养眼theme之配置...

http://latest.scitools.com/Understand/Understand-4.0.877-Linux-64bit.tgzUnderstand软件的功能主要定位于代码的阅读理解。 默认的understand代码阅读风格为understand风格,即白底黑字,十分的伤眼,其实可以配置为黑底绿字等养眼风格的style。可选的风格有:aqua,abbr. Aquarius(Lat...

weixin_39866487的博客 318
上一篇: Base64笔记
下一篇: 5 Shell Scripts for Linux Newbies to Learn Shell Programming – Part II
JJDiaries
博客等级 码龄15年 33粉丝 42原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值