Официальное руководство по shrl exe

Superhot Trophy Guide and Road Map for PlayStation 4

Welcome to our Superhot Trophy Guide. Superhot is an incredible FPS experience in which the flow of time is tied directly to your movements. Strafe around bullets, spear multiple enemies at once with a thrown katana, and even take over the minds of your enemies.

Slowing down the combat allows you to take a step back and assess your surroundings and the tools within them. You’ll feel like Neo as you casually walk around gunfire just to mock your helpless foes.

The trophy journey will squeeze a lot from you in terms of skill and willpower. You’ll really be put through the wringer with some of the later challenges, which even go as far as to ask for you to complete the whole game without dying once. It’s a rough ride, but there is plenty of pride up for grabs!

Phase One – Superhot.exe

In this initial phase of our Superhot Trophy Guide, just focus on completing the main story to unlock the other modes. Enjoy the game, familiarize yourself with the mechanics, and come back here when the credits roll for Phase Two!

Unmissable Story Trophies

Trophy Image

Trophy Image

Access Denied

Complete SUBWAY level.

As you play through the story, you’ll eventually come to a level next to a train in a Subway. Some story events will occur in which you’re booted from the game, and the “Access Denied” trophy unlocks as you return to the game’s Omni-piOS system. Totally unavoidable.

Trophy Image

Trophy Image

We Can See You

Complete SERV level.

Continue progressing the story until you defeat a group of enemies in a server room. Afterward, a story sequence will play out, in which you’ll see the on-screen text state “We Can See You” before you’re booted from the game again, unlocking the “We Can See You” trophy unavoidably in the process.

Trophy Image

Trophy Image

We Told You To Leave

Get back to the system after being expelled.

Proceed through the story and launch superhot.exe again despite being made to promise you wouldn’t. Complete the next few levels to reach a story sequence where “See if it hurts” appears on-screen. Upon being returned to the Omni-piOS, you will unavoidably unlock the “We Told You To Leave” trophy.

Trophy Image

Trophy Image

One of us

Complete the game.

The “One of us” trophy will unlock automatically at the end of the story, as the Credits begin to play.

Phase Two – C:ENDLESS

One of the two modes you unlock for beating the game is “Endless Mode,” which you can access via the .lvl files in the ENDLESS folder on the Omni-piOS system.

In each level, you will need to rack up a total of around 150 cumulative kills to unlock the next level. Which is to say that you do not need to get all 150 kills in one run to unlock the next level; just keep replaying the level and killing enemies until the next stage unlocks.

Even once you’re done, however, you’ll need to stick around in ENDLESS Mode to earn extra kills for the Can’t get enough trophy.

ENDLESS Mode Trophies

Trophy Image

Trophy Image

Full Package

Unlock all endless levels.

The “Full Package” trophy asks that you unlock all 36 Endless Levels in the Superhot Base Game across Nine ARENAS (each having 4 Levels). You will start with three ARENA Levels Unlocked, and then you will need to unlock the rest by accumulating Kills on the ones you have available.

You will need to get around 150 Kills in each ENDLESS ARENA Levels to unlock all available ENDLESS MODE levels for that ARENA. However, this value is cumulative, meaning you won’t have to get 150 kills in a single run; you can just keep replaying the level and racking up kills until all three MODE Levels are unlocked for that ARENA, and then move on.

Note that you only need to play the ARENA levels (i.e. “LAB#18.lvl” or ” BRIDGE.lvl”) and not the MODE levels (i.e. “#18_RACE.lvl” or “STR_TIME.lvl”). You won’t ever need to complete the MODE Levels for this or any other trophy.

The game will notify you via on-screen text when a new ENDLESS Level has become available. You can safely hit to return to the ENDLESS menu once you’ve seen this if you want, and don’t need to finish the event.

Note that even if you have all the MODES for the first 8 ARENAs, the 9th ARENA won’t unlock right away. It seems to have a higher unlock counter than other ARENAs, but you can see by hovering over it how many more kills you need. Replay the other ARENAs until you have that many kills and then it will unlock.

Once you have access to all 36 ENDLESS levels in all 9 Arenas, the Full Package trophy will unlock the next time you return to the System with !

Trophy Image

Trophy Image

Can’t get enough

Kill over 1987 Red Dudes in endless mode.

By the time you’re done unlocking all of the levels in ENDLESS mode for the Full Package trophy, you should have racked up somewhere around 1500 kills.

Unfortunately, as there’s no in-game tracker, it’s hard to know exactly how many enemies you have killed. Just continue playing an ENDLESS level of your choice until you eventually reach a total of 1987 Red Dudes killed in ENDLESS. At that point, the Can’t get enough trophy will unlock immediately!

The best stage I found for this way OFFICE.lvl. Just get your hands on a Katana and then hide in a cubicle for the whole fight. Enemies will be forced to get close to you so that they can fire at you, but they’ll be close enough for you to slice them up with the Katana before they get a chance to shoot.

Use this method to repeatedly farm around 50 kills per run, depending on how good you get at keeping the combo going. The longer you survive, the more enemies they send at you, making the trophy progress quicker.

Phase Three – C:CHALLENGE

This is by far the hardest part of your trophy journey. Here in Phase Three of our Superhot Trophy Guide, your reflexes, skills, and knowledge of the game will be truly tested. You will need to complete almost every level of the story again at least 13 more times in the CHALLENGE folder of the System.

Each version of the game in the CHALLENGE folder has certain active modifiers; some fun, some brutal. You will need to not only complete every level in every CHALLENGE mode, but you’ll need also to achieve strict times on both SPEEDRUN Challenge Modes.

CHALLENGE Mode Trophies

Trophy Image

Trophy Image

Stand REDy

Get RED ending in every level of SPEEDRUN challenge.

The SPEEDRUN Challenge records your time only when the game is in motion. When you stand still or slow down, the timer will stop and slow too!

The goal here is to beat all 25 Levels in the SPEEDRUN CHALLENGE while achieving a “RED” time.

There’s no way to see the “RED” time until you beat the level once. Speed through the level as quickly as you can, and you’ll see the developer-determined “RED” time on the top of the HUD. If your run time was not equal or less than the RED time, you’ll need to replay the level and try to go faster to beat the RED time.

It helps to note that Jumping is actually a lot quicker than walking in Superhot, so jumping from point to point (holding to maintain slow-mo) will allow you to keep your times down.

You can press at the end of a level to quickly relaunch it and try again if you fail. Just continue this method of trial and error, taking each level one at a time, until you eventually manage to achieve the RED time, then move on to the next level and so on and so forth.

Trophy Image

Trophy Image

Get REDy

Get RED ending in every level of SPEEDRUNrt challenge.

The Get REDy trophy is near-identical to the Stand REDy trophy, except you will be asked to instead achieve RED times in all 25 SPEEDRUNrt Challenge levels.

SPEEDRUNrt is a bit more brutal than SPEEDRUN, because the timer moves in realtime and is not affected by the in-game time slowing. Fortunately, the RED times in SPEEDRUNrt are a bit more forgiving than in SPEEDRUN, but they are still very difficult to achieve.

Use the same methods as detailed for Stand REDy, but try not to aim so much. Stupid, I know, but if you’re spending more than a few seconds lining up a shot then you’ve already failed. You’ll need to really know these levels like the back of your hand so you can quickly and consistently kill every enemy with fluid motion.

Pulling this trophy off should give you a great sense of accomplishment as it’s no easy feat, but all just part of the long road to the Hercules trophy.

Trophy Image

Trophy Image

Hercules

Beat all Challenges.

To unlock the “Hercules” challenge, you will need to beat all 13 CHALLENGE modes. Some will be locked at first, but you’ll unlock more by progressing the modes you already have.

See the table below for details of each mode and what they entail:

Mode Conditions
Katana Only You can only use Katanas. You can’t even punch or throw objects.
ADS2013 Based on an old 2013 version of Superhot. Punches insta-kill, but there are no melee weapons. You can pick up weapons but not objects, items are not conveniently highlighted, and you cannot throw.
Ghost You can use Hotswitching from the very first level. You cannot use weapons but your punches insta-kill.
Fullstop Challenge Time stops completely when you stop moving. Time also stays frozen even when you look around with . However, enemy bullets move much faster.
Killing Throws You cannot shoot, only throw. Thrown objects/weapons kill enemies in one hit. Enemies now take 5-6 punches instead of 2-3.
Barehands No weapons. No throwing. Nothing. Just punching. Enemies still take three punches to kill in this mode. Only 24 Levels.
SPEEDRUN Challenge Your time is recorded with the in-game clock, slowing and stopping when you do. Each level has “RED” scores for you to aim for. Earn RED in all SPEEDRUN levels for Stand REDy.
SPEEDRUNrt Your time is recorded in real time; slowing and stopping has no effect on the timer. Each level has “RED” scores for you to aim for. Earn RED in all SPEEDRUNrt levels for Get REDy.
Hotswitch Another SPEEDRUN mode but you only play the first 18 levels. You will have access to Hotswitch from the start and must try to beat RED times.
Hard Mode The game, but harder. Time moves faster, and punches are weaker.
Impossible Mode Hard Mode, but harder. Time moves even faster, gun have one bullet, and punches are weak.
Norestart The worst part of the trophy journey. The trophy journey could be considered a 4/10 if not for this brutal CHALLENGE. You will need to beat all 25 levels start-to-finish, back-to-back, without dying or pressing to leave. Time does stop completely when you do in this mode, though.
FunFunFun A well-deserved reward for making it this far. Punches kill, throwing kills, enemies have huge heads, and the text is a bit more “fun”.
Note that the PUMPKIN Challenge is not required for this trophy!

Phase Four – Secret Hidden Terminals

The game’s biggest hurdle is now out of the way; it’s time for something a little more casual. Almost every Story Mission contains a hidden terminal for you to find and activate.

Honestly, I wouldn’t be surprised if you made it this far without ever seeing a terminal of any kind. I certainly did. But, fortunately, we have a playlist of videos that you can use to track down and activate all 27 secret terminals.

Focus on doing exactly that in this phase of our Superhot Trophy Guide!

Find all 27 Hidden Terminals

Trophy Image

Trophy Image

Charted

Find every hidden terminal.

Follow our videos to find all 27 of the terminals hidden throughout the Superhot story levels. Once you have activated all 27, the Charted trophy will unlock the next time you return to the Omni piOS System!

You can see from the level select if you’ve found a secret terminal, as the “-LEVEL->” text changes to “CRACKED!” and the right-hand screen will say “SECRET CRACKED.” Levels without a secret have no text on the right-hand panel.

Phase Five – Cleanup

There is a very strong likelihood at this stage in your trophy journey for you to have naturally unlocked almost every remaining misc trophy. I’ve divided the remaining trophies up by those that you can unlock in the Omni piOS System and those that you must earn through Superhot gameplay.

Browse the selection below to see if there are any trophies still standing between you and the Platinum, but if you made it this far, I don’t think anything could stop you now!

Misc System Trophies

Trophy Image

Trophy Image

Bored

Launch every app in the system.

To unlock the “Bored” trophy, you just need to open every “.exe” or “.wir” file on your Omni-piOS system except superhot.exe. You can only do this once you’ve finished the game because you need to launch credits.exe and more.exe, which only appear once you beat the story once.

You don’t need to watch or “play” the apps you open, and you can just quit them immediately with after opening them once. Note that you don’t need to launch any of the fake apps in shrl.exe for this trophy.

In your system, after beating the story, launch each of the .exe and .wir files in the table below. Once you’ve activated each one at least once, the “Bored” trophy will unlock.

Filename Location
credits.exe C: (Requires Story Completion)
more.exe C: (Requires Story Completion. Press on it. Nothing will happen, but it’ll count. If unsure, leave til last.)
carpets.exe C:APPS
cartrip.exe C:APPS
ggroups.exe C:APPS
sinus1.exe C:DEMOS
sinus2.exe C:DEMOS
sinus3.exe C:DEMOS
stars.exe C:DEMOS
mirrors.exe C:DEMOS
letters.exe C:DEMOS
fire.exe C:DEMOS
rotozoom.exe C:DEMOS
pipes.exe C:DEMOS
life.exe C:CELLULAR
ant.exe C:CELLULAR
forest.exe C:CELLULAR
sand.exe C:CELLULAR
water.exe C:CELLULAR
diodes.wir C:WIRES
repeater.wir C:WIRES
gateAND1.wir C:WIRES
gateAND2.wir C:WIRES
gateAND3.wir C:WIRES
bigAND.wir C:WIRES
gateOR1.wir C:WIRES
gateOR2.wir C:WIRES
gateOR3.wir C:WIRES
bigOR.wir C:WIRES
gateXOR1.wir C:WIRES
gateXOR2.wir C:WIRES
gateXOR3.wir C:WIRES
bigXOR.wir C:WIRES
neon.wir C:WIRES
treedude.exe C:GAMES
shrl.exe C:GAMES
vr.exe C:VR
cube.exe C:VR
cylinder.exe C:VR
diy.exe C:ARTOTHERRANDOMHYPNO

Trophy Image

Trophy Image

Deep Web

Become part of the community.

After beating the game for the first time, open up the “APPS” folder in the System and then open the “ggroups.exe” app.

Just leave this running for a while. Read the dialogue if you want, or just step away and wait for the conversation to end. Either way, when you’ve left the app open long enough for the dialogue to conclude, the Deep Web trophy will unlock!

Misc Gameplay Trophies

Trophy Image

Trophy Image

It’s a me, Mario!

Kill an enemy by jumping on him.

In some Levels (such as 30GATE.lvl) and ENDLESS mode spawns, you will start the level above an enemy.

From there, you can use to leap into the air and then land on top of the enemy, immediately killing them and unlocking the “It’s a me! Mario!” trophy.

Trophy Image

Trophy Image

Just

Kill 100 Red Dudes with a pistol.

Cumulative

The standard Pistol weapon is very common throughout the game, so the chances of you killing 100 enemies with a pistol without even trying are extremely high, making the trophy very likely to unlock naturally.

It’s easy to farm kills anyway; just load up any level with a pistol, then keep killing enemies and restarting over and over to accumulate kills.

You don’t need 100 kills in one level or one playthrough; this trophy counts every kill with a pistol across your whole time playing the game.

Trophy Image

Trophy Image

Killing

Kill 100 Red Dudes with a shotgun.

The Killing trophy is near-identical to the Just trophy, except you need to use a Shotgun instead of a Pistol. The Shotgun is a lot less common than the Pistol, so while it’s still possible for you to unlock this trophy naturally, it’s much less likely.

The best way to farm kills is just to load up a Level that you know has a Shotgun in it, then repeatedly grab the shotgun, get kills, and restart the mission. Repeat to accumulate a total of 100 kills with the Shotgun and unlock the Killing trophy.

Trophy Image

Trophy Image

Red

Kill 100 Red Dudes with a rifle.

The Red trophy, much like the Killing trophy is near-identical to the Just trophy, except you need to use n Assault Rifle to get kills. The The Assault Rifle is a lot less common than the Pistol, so while it’s still possible for you to unlock this trophy naturally, it’s much less likely.

The best way to farm kills is just to load up a Level that you know has n Assault Rifle in it, then repeatedly grab the rifle, get kills, and restart the mission. Repeat to accumulate a total of 100 kills with the Assault Rifle and unlock the Red trophy.

Trophy Image

Trophy Image

Dudes

Kill 100 Red Dudes using melee.

To unlock the “Dudes” trophy, you need to defeat 100 enemies via Melee attacks. You can do this either by just punching with while having no weapon equipped (it takes three punches to kill an enemy) or by hitting them with melee weapons like Baseball Bats.

This trophy is fairly likely to unlock naturally, especially during ENDLESS mode, if you use melee weapons often. If not, you will need to farm the trophy by replaying STORY or ENDLESS levels.

Trophy Image

Trophy Image

With Katana

Kill 100 Red Dudes with a katana.

The With Katana Trophy is like the Dudes, Killing, and Just trophies. You will need to kill 100 enemies with the Katana only.

Considering you will need to complete a Katana-only run as part of your trophy journey, the With Katana trophy should unlock naturally while you’re doing that.

Trophy Image

Trophy Image

No they didn’t

Shoot down a bullet with a bullet.

To unlock the “No they didn’t” trophy, you will need to shoot an enemy’s bullet out of the air. Since the game is in slow-mo, this is actually not too difficult to pull off, as you can just aim at bullets in the air and carefully time out your shot so that the bullets meet.

This is a lot easier when Shotguns and Assault rifles are involved because the sheer volume of bullets in the air makes this trophy very likely to unlock naturally. In fact, that’s exactly how I earned it myself during my first playthrough of the main story.

Trophy Image

Trophy Image

Pointless but cool

Score 100 headshots.

Cumulative

As you may have gathered from the trophy name, getting headshots in Superhot is pretty pointless because any gunshot will kill any enemy regardless of where you hit them. The “Pointless but cool” trophy asks that you ignore that fact and get headshots anyway.

In Superhot, 100 kills is nothing. You’ll have 100 kills or more in your first 30 minutes of playing the game. Just spend a little bit of your playthrough aiming at enemy heads and you’ll unlock the trophy naturally during your first playthrough.

If you choose to farm the trophy instead, just replay the same level over and over, getting headshots and reloading with until the trophy requirements are satisfied.

Trophy Image

Trophy Image

Conserve Ammo

Kill 3 Red Dudes with one shotgun shot.

The “Conserve Ammo” trophy asks that you kill three Red Dudes at once with a single shotgun blast. This trophy is pretty difficult to set up because there are so many variables at play. First, you need a shotgun, then you need three people lined up, then you need the randomised spread of the shotgun blast to actually hit all three of them individually.

Shotgun pellets despawn when they find a target, too, so you can just shot through enemies, they really need to be side-by-side. I was eventually able to earn this trophy by accident, while using a Shotgun in ENDLESS mode and getting very lucky with lots of things lining up.

If you end up needing to grind this trophy out, though, you should try to do so in the Story Level “21MEETIN.lvl”

The first enemy after you pass security has a Shotgun. Kill him and grab it, then try to line up the next three enemies as the meeting room opens, to get them in a single shot. Restart the level with and then re-attempt as needed until you succeed.

Trophy Image

Trophy Image

Ratatatata!

Kill 3 Red Dudes with one rifle burst.

When you fire an Assault Rifle, it will shoot around four bullets in a row, or you can hold to keep firing. Using this single burst of fire, you will need to line up your shot so that at least 3 of your bullets find a unique target.

Successfully killing three enemies with a single burst of an Assault Rifle will unlock the Ratatatata! trophy.

You’ll get many opportunities to earn this trophy while making your way through the ENDLESS levels. Another good place to earn the trophy is in the Story Level “TIRALL.lvl”

Just load the level, avoid the truck by backing into the alleyway on your left, then grab a bottle near where the truck stops.

Throw the bottle at the red guy who comes out with an assault rifle, then immediately turn around and use it on the three enemies that come down the alleyway towards you.

If you fail to hit all three, hold to restart the mission and then try again until you succeed!

Trophy Image

Trophy Image

Shishkebap

Kill 2 Red Dudes with one katana throw.

The Shishkebap trophy is pretty easy and is actually possible as soon as you get the Katana for the first time during a corridor section of the story (19OLDBOY.lvl).

With a Katana in hand, try to line yourself up so that two enemies are in single-file directly in front of you, one behind the other.

With the right setup, press to throw your Katana like a spear, impaling both enemies in a single throw and unlocking the Shishkebap trophy.

Trophy Image

Trophy Image

So it is possible!

Cut bullet with a katana.

Much like Shishkebap, the “So it is possible!” trophy is unlockable from the very moment you first find a Katana during the story (19OLDBOY.lvl), but there will be many opportunities to get this trophy whenever there’s a Katana nearby and some enemies with guns.

While holding a Katana, wait for an enemy to fire a gun at you, preferably a pistol, then slowly line yourself up so that you’re close to the bullet that was fired. For safety, try to get an angle so that if you miss, the bullet won’t just go straight through your head.

When ready, hit while aiming at the bullet to slice it in half. It might take a few attempts to get the timing right. If you’re correctly aimed at the bullet, a red overlay will appear over it. After successfully slicing a bullet with a Katana, you will unlock the trophy.

Trophy Image

Trophy Image

Pumpkin Spiced SUPERHOT

Launch Pumpkin Spiced Challenge between 24.10 & 7.11

The “PUMPKIN” Challenge will only appear in the CHALLENGE folder between October 24th and November 7th. Fortunately for those who got Superhot from PS Plus, this date isn’t far away, and you could actually just wait and earn the trophy legitimately.

Instead of waiting, though, you can just edit the clock settings on your console. The game will believe that the date is accurate, and you’ll be allowed to play the PUMPKIN Challenge.

This challenge is not required for Hercules.

All you need to do is start up the first level, and the “Pumpkin Spiced SUPERHOT” trophy will unlock.

Trophy Image

Trophy Image

Spread the system

Capture the replay.

At the end of a story level, when your replay is playing out and the words “SUPER HOT” keep flashing up, you can press to edit your replay footage.

When you’re done, you can pres again to capture the replay and save it. Doing this for the first time will unlock the “Spread the system” trophy.

Plat Get!

Trophy Image

Trophy Image

Trophy Hunter

Obtain all the Trophies

Once you have acquired every other trophy in this Superhot Trophy Guide, the “Trophy Hunter” platinum trophy will unlock.

Thank you for choosing PlatGet as your source for a Superhot Trophy Guide. Consider checking out our other guides!

Follow us on Twitter @GetPlat or Instagram @platget for updates on new reviews and guides, as well as small anecdotes about our platinum journeys.

Скачать сейчас

Ваша операционная система:

Как исправить ошибку Shrl30.dll?

Прежде всего, стоит понять, почему shrl30.dll файл отсутствует и почему возникают shrl30.dll ошибки. Широко распространены ситуации, когда программное обеспечение не работает из-за недостатков в .dll-файлах.


What is a DLL file, and why you receive DLL errors?

DLL (Dynamic-Link Libraries) — это общие библиотеки в Microsoft Windows, реализованные корпорацией Microsoft. Файлы DLL не менее важны, чем файлы с расширением EXE, а реализовать DLL-архивы без утилит с расширением .exe просто невозможно.:


Когда появляется отсутствующая ошибка Shrl30.dll?

Если вы видите эти сообщения, то у вас проблемы с Shrl30.dll:

  • Программа не запускается, потому что Shrl30.dll отсутствует на вашем компьютере.
  • Shrl30.dll пропала.
  • Shrl30.dll не найдена.
  • Shrl30.dll пропала с вашего компьютера. Попробуйте переустановить программу, чтобы исправить эту проблему.
  • «Это приложение не запустилось из-за того, что Shrl30.dll не была найдена. Переустановка приложения может исправить эту проблему.»

Но что делать, когда возникают проблемы при запуске программы? В данном случае проблема с Shrl30.dll. Вот несколько способов быстро и навсегда устранить эту ошибку.:


метод 1: Скачать Shrl30.dll и установить вручную

Прежде всего, вам нужно скачать Shrl30.dll на ПК с нашего сайта.

  • Скопируйте файл в директорию установки программы после того, как он пропустит DLL-файл.
  • Или переместить файл DLL в директорию вашей системы (C:WindowsSystem32, и на 64 бита в C:WindowsSysWOW64).
  • Теперь нужно перезагрузить компьютер.

Если этот метод не помогает и вы видите такие сообщения — «shrl30.dll Missing» или «shrl30.dll Not Found,» перейдите к следующему шагу.

Shrl30.dll Версии

Версия

биты

Компания

Язык

Размер

10.0.432.811

32 bit

Microsoft Corporation

U.S. English

0.66 MB


метод 2: Исправление Shrl30.dll автоматически с помощью инструмента для исправления ошибок

Как показывает практика, ошибка вызвана непреднамеренным удалением файла Shrl30.dll, что приводит к аварийному завершению работы приложений. Вредоносные программы и заражения ими приводят к тому, что Shrl30.dll вместе с остальными системными файлами становится поврежденной.

Вы можете исправить Shrl30.dll автоматически с помощью инструмента для исправления ошибок! Такое устройство предназначено для восстановления поврежденных/удаленных файлов в папках Windows. Установите его, запустите, и программа автоматически исправит ваши Shrl30.dll проблемы.

Если этот метод не помогает, переходите к следующему шагу.


метод
3: Установка или переустановка пакета Microsoft Visual C ++ Redistributable Package

Ошибка Shrl30.dll также может появиться из-за пакета Microsoft Visual C++ Redistribtable Package. Необходимо проверить наличие обновлений и переустановить программное обеспечение. Для этого воспользуйтесь поиском Windows Updates. Найдя пакет Microsoft Visual C++ Redistributable Package, вы можете обновить его или удалить устаревшую версию и переустановить программу.

  • Нажмите клавишу с логотипом Windows на клавиатуре — выберите Панель управления — просмотрите категории — нажмите на кнопку Uninstall.
  • Проверить версию Microsoft Visual C++ Redistributable — удалить старую версию.
  • Повторить деинсталляцию с остальной частью Microsoft Visual C++ Redistributable.
  • Вы можете установить с официального сайта Microsoft третью версию редистрибутива 2015 года Visual C++ Redistribtable.
  • После загрузки установочного файла запустите его и установите на свой ПК.
  • Перезагрузите компьютер после успешной установки.

Если этот метод не помогает, перейдите к следующему шагу.


метод
4: Переустановить программу

Как только конкретная программа начинает давать сбой из-за отсутствия .DLL файла, переустановите программу так, чтобы проблема была безопасно решена.

Если этот метод не помогает, перейдите к следующему шагу.


метод
5: Сканируйте систему на наличие вредоносного ПО и вирусов

System File Checker (SFC) — утилита в Windows, позволяющая пользователям сканировать системные файлы Windows на наличие повреждений и восстанавливать их. Данное руководство описывает, как запустить утилиту System File Checker (SFC.exe) для сканирования системных файлов и восстановления отсутствующих или поврежденных системных файлов (включая файлы .DLL). Если файл Windows Resource Protection (WRP) отсутствует или поврежден, Windows может вести себя не так, как ожидалось. Например, некоторые функции Windows могут не работать или Windows может выйти из строя. Опция «sfc scannow» является одним из нескольких специальных переключателей, доступных с помощью команды sfc, команды командной строки, используемой для запуска System File Checker. Чтобы запустить её, сначала откройте командную строку, введя «командную строку» в поле «Поиск», щелкните правой кнопкой мыши на «Командная строка», а затем выберите «Запустить от имени администратора» из выпадающего меню, чтобы запустить командную строку с правами администратора. Вы должны запустить повышенную командную строку, чтобы иметь возможность выполнить сканирование SFC.

  • Запустите полное сканирование системы за счет антивирусной программы. Не полагайтесь только на Windows Defender. Лучше выбирать дополнительные антивирусные программы параллельно.
  • После обнаружения угрозы необходимо переустановить программу, отображающую данное уведомление. В большинстве случаев, необходимо переустановить программу так, чтобы проблема сразу же исчезла.
  • Попробуйте выполнить восстановление при запуске системы, если все вышеперечисленные шаги не помогают.
  • В крайнем случае переустановите операционную систему Windows.

В окне командной строки введите «sfc /scannow» и нажмите Enter на клавиатуре для выполнения этой команды. Программа System File Checker запустится и должна занять некоторое время (около 15 минут). Подождите, пока процесс сканирования завершится, и перезагрузите компьютер, чтобы убедиться, что вы все еще получаете ошибку «Программа не может запуститься из-за ошибки Shrl30.dll отсутствует на вашем компьютере.


метод 6: Использовать очиститель реестра

Registry Cleaner — мощная утилита, которая может очищать ненужные файлы, исправлять проблемы реестра, выяснять причины медленной работы ПК и устранять их. Программа идеально подходит для работы на ПК. Люди с правами администратора могут быстро сканировать и затем очищать реестр.

  • Загрузите приложение в операционную систему Windows.
  • Теперь установите программу и запустите ее. Утилита автоматически очистит и исправит проблемные места на вашем компьютере.

Если этот метод не помогает, переходите к следующему шагу.


Frequently Asked Questions (FAQ)

QКакая последняя версия файла shrl30.dll?

A10.0.432.811 — последняя версия shrl30.dll, доступная для скачивания

QКуда мне поместить shrl30.dll файлы в Windows 10?

Ashrl30.dll должны быть расположены в системной папке Windows

QКак установить отсутствующую shrl30.dll

AПроще всего использовать инструмент для исправления ошибок dll

There’s lack of Red Guys to kill in this level!

This article is a stub. You can help the SUPERHOT Wiki by expanding it.

SHRL, short for Super Hot Rogue Like, is a minigame found in SUPERHOT: MIND CONTROL DELETE. It was first teased as shrl.exe in SUPERHOT.

Last Updated: October 8, 2022

Quicklinks

  • Secrets (Hidden Terminals)
  • Treedude and Other Extras
  • The «shrl.exe» File
  • In-Game Trailers
  • Endless Mode, Challenge Mode
  • Basic Tips

Superhot

  • First Released:
    Feb 24, 2016
  • Genres: Shooter, Puzzle, Tactical, Indie
  • Platforms: Mac,PC,Xbox One,PlayStation 4,Linux
  • Developer: SUPERHOT Team
  • Publisher: SUPERHOT Team
  • Ratings: PEGI 12, ESRB T

Are you enjoying Superhot?

Click a score button below to add your rating… or even Write a review!

Secrets (Hidden Terminals)

Easter Eggs

There are 27 hidden Terminals in Superhot. Every level has one. They are typically found in areas that are difficult to reach and are often out-of-bounds. Keep in mind that at least one enemy in the level must still be alive for you to access the terminal, or the level will end before you can get to it. When you reach one, just interact with the terminal to see its message. After that, you can leave the level and enter the next level if you don’t want to play through the whole thing.

If you’re having trouble finding all 27 Terminals, use the video guide below to help you reach them.

Treedude and Other Extras

Easter Eggs

In addition to the main game (superhot.exe), there are extra materials you can access from the starting screen of Superhot, including a mini-game called Treedude where your goal is to chop the tree without running into any branches. There are numerous small “apps,” ASCII art, and other extras you can access, as well.

The «shrl.exe» File

Easter Eggs

Superhot also included what seemed to be another mini-game that no one could access, called shrl.exe. It would ask for a password, and players spent a great deal of time trying to access it. It was eventually revealed that “shrl” stood for “Superhot Roguelike,” but it is inaccessible through normal means.

Since the developers later made a roguelike standalone expansion called Superhot: Mind Control Delete, shrl.exe might have been intended as an early tease of what was to come.

In-Game Trailers

Easter Eggs

From within Superhot, you can watch the Superhot trailers, but they’ve been redone to match the limited graphics of the in-game operating system.

Endless Mode, Challenge Mode

Unlockables

After you beat the main story mode, you will unlock the Endless and Challenge modes. These two modes themselves have multiple modes you can try. Endless Mode provides you with a few different modes where either you can play for as long as you want or you’re tasked with a specific time-based goal. Challenge Mode lets you pick from a variety of challenges to complete, ranging from speedruns to a mode where you can use Hotswitch from the start to modes where you can’t use guns. There are a variety of “hard mode” challenges within this mode, as well, if you’re looking for a particularly tough challenge.

Basic Tips

Hints

Don’t forget that you can take as much time as you need to plan out your actions. There’s no need to rush. Look around, plan out strategies, and move carefully to keep track of the situation.

Slow movements will also help you predicts where your enemies are headed and set up shots to take them down.

If you jump and land perfectly on top of an enemy, it will kill them.

There is a sound when enemies spawn that can help you figure out where they are.

If you’re attacking an enemy with your fists, don’t delay for too long. If you wait too long, the damage will reset as if you hadn’t attacked them.

There is friendly fire on the enemies’ side. If you position yourself correctly, you can make them shoot each other.

When you run out of ammo, you can throw your weapon, which will stun the enemy briefly and possibly make them drop their weapon.

You can also throw objects at enemies for the same effect.

Questions, Answers and Comments

Ask a Question

We also have a page for this game on….

Время на прочтение
12 мин

Количество просмотров 277K

Зачем и для кого статья?

Изначально это была памятка для студентов, которые начинают работать с unix-подобными системами. Иными словами, статья рассчитана на тех, кто не имеет предыдущего опыта работы в unix-овой командной строке, но по тем или иным причинам хочет или должен научиться эффективно с нею взаимодействовать.

Здесь не будет пересказа манов (документации), и статья никак не отменяет и не заменяет их чтение. Вместо этого я расскажу о главных вещах (командах, приемах и принципах), которые надо осознать с самого начала работы в unix shell-е, чтобы работа происходила эффективно и приятно.

Статья касается полноценных unix-подобных окружений, с полнофункциональным шеллом (предпочтительно zsh или bash)и достаточно широким набором стандартных программ.

Что такое шелл

Shell (шелл, он же «командная строка», он же CLI, он же «консоль», он же «терминал», он же «черное окошко с белыми буковками») — это текстовый интерфейс общения с операционной системой (ну, строго говря, это программа, которая таковой интерфейс обеспечивает, но сейчас это различие несущественно).

В целом работа через шелл выглядит так: пользователь (т.е. вы) с клавиатуры вводит команду, нажимает Enter, система выполняет команду, пишет на экран результат выполнения, и снова ожидает ввода следующей команды.

Типичный вид шелла:
типичный вид шелла

Шелл — это основной способ для взаимодействия со всеми Unix-подобными серверными системами.

Где встречаются системы с командной строкой?

Где вас может поджидать unix-овый шелл, популярные варианты:

  • MacOS (bash);
  • удаленный доступ на сервер по работе или для личного веб-проекта;
  • домашний файл-сервер с удаленным доступом;
  • Ubuntu, PC-BSD на ноутбуке/десктопе — unix-подобные системы сегодня просты в установке и использовании.

Какие задачи разумно решать шеллом?

Естественные задачи, для которых шелл пригоден, полезен и незаменим:

  • интерактивная работа в терминале:
    • выполнение компиляции, запуск заданий через make;
    • сравнение текстовых файлов;
    • быстрый ad-hoc анализ данных (количество уникальных ip в логе, распределение записей по часам/минутам и т.п.);
    • разовые массовые действия (прибить много процессов; если работаете с системой контроля версий — ревертнуть или зарезолвить кучу файлов);
    • диагностика происходящего в системе (семафоры, локи, процессы, дескрипторы, место на диске и т.п.);
  • скриптование:
    • установочные скрипты, для выполнения которых нельзя рассчитывать на наличие других интерпретаторов — это не для новичков;
    • функции для кастомизации интерактивного шелла (влияющие на приглашение, меняющие каталог, устанавливающие переменные окружения) — тоже не совсем для новичков;
    • одноразовые скрипты типа массового перекодирования файлов;
    • makefile-ы.

Абсолютно первые шаги

Начинаем работу: войти и выйти

Убедитесь, что точно знаете, как запустить шелл и как из него выйти.

Если вы работаете за машиной, на которой установлена Ubuntu, вам надо запустить программу Terminal. По окончании работы можно просто закрыть окно.

На MacOS — тоже запустить Terminal.

Для доступа к удаленному серверу — воспользоваться ssh (если локально у вас MacOS, Ubuntu или другая unix-like система) или putty (если у вас Windows).

Кто я, где я?

Выполните следующие команды:

  • hostname — выводит имя машины (сервера), на которой вы сейчас находитесь;
  • whoami — выводит ваш логин (ваше имя в системе);
  • tree -d / |less — псевдографическое изображение дерева каталогов на машине; выход из пролистывания — q;
  • pwd — выводит каталог, в котором вы сейчас находитесь; в командной строке вы не можете быть «просто так», вы обязательно находитесь в каком-то каталоге (=текущий каталог, рабочий каталог). Вероятно, текущий рабочий каталог выводится у вас в приглашении (prompt).
  • ls — список файлов в текущем каталоге; ls /home — список файлов в указанном каталоге;

История команд (history)

Важное свойство полноценной командной строки — история команд.

Выполните несколько команд: hostname, ls, pwd, whoami. Теперь нажмите клавишу «вверх». В строке ввода появилась предыдущая команда. Клавишами «вверх» и «вниз» можно перемещаться вперед и назад по истории. Когда долистаете до hostname, нажмите Enter — команда выполнится еще раз.

Команды из истории можно не просто выполнять повторно, а еще и редактировать. Долистайте историю до команды ls, добавьте к ней ключ -l (получилось ls -l, перед минусом пробел есть, а после — нет). Нажмите Enter — выполнится модифицированная команда.

Пролистывание истории, редактирование и повторное выполнение команд — самые типичные действия при работе в командной строке, привыкайте.

Copy-paste

Командная строка очень текстоцентрична: команды — это текст, входные данные для большинства стандартных программ — текст, результат работы — чаще всего тоже текст.

Прекрасной особенностью текста является то, что его можно копировать и вставлять, это верно и для командной строки.

Попробуйте выполнить команду date +"%y-%m-%d, %A"
Вводили ли вы ее целиком руками или скопировали из статьи? Убедитесь, что вы можете ее скопировать, вставить в терминал и выполнить.

После того, как научитесь пользоваться man‘ом, убедитесь, что можете скопировать и выполнить примеры команд из справки. Для проверки найдите в справке по программе date раздел EXAMPLES, скопируйте и выполните первый приведенный пример (на всякий случай: знак доллара не является частью команды, это условное изображение приглашения к вводу).

Как именно копировать текст из терминала и вставлять его в терминал — зависит от вашей системы и от ее настроек, поэтому дать универсальную инструкцию, к сожалению, не получится. На Ubuntu попробуйте так: копирование — просто выделение мышью, вставка — средняя кнопка мыши. Если не работает, или если у вас другая система — поищите в Интернете или спросите более опытных знакомых.

Ключи и опции

При исследовании истории команд вы уже столкнулись с тем, что у команды ls есть по крайней мере два варианта. Если вызвать ее просто так, она выводит простой список:

[22:26]akira@latitude-e7240:
~/shell-survival-quide> ls
Makefile  shell-first-steps.md  shell-first-steps.pdf
shell-survival-quide.md  shell-survival-quide.pdf

Если же добавить ключ -l, к каждому файлу выводится подробная информация:

[22:28]akira@latitude-e7240:
~/shell-survival-quide> ls -l 
total 332
-rw-rw-r-- 1 akira akira    198 Feb 13 11:48 Makefile
-rw-rw-r-- 1 akira akira  15107 Feb 14 22:26 shell-first-steps.md
-rw-rw-r-- 1 akira akira 146226 Feb 13 11:49 shell-first-steps.pdf
-rw-rw-r-- 1 akira akira  16626 Feb 13 11:45 shell-survival-quide.md
-rw-rw-r-- 1 akira akira 146203 Feb 13 11:35 shell-survival-quide.pdf

Это очень типичная ситуация: если к вызову команды добавлять специальные модификаторы (ключи, опции, параметры), поведение команды меняется. Сравните: tree / и tree -d /, hostname и hostname -f.

Кроме того, команды могут принимать в качестве параметров имена файлов, каталогов или просто текстовые строки. Попробуйте:

ls -ld /home
ls -l /home
grep root /etc/passwd

man

man — справка по командам и программам, доступным на вашей машине, а также по системным вызовам и стандартной библиотеке C.

Попробуйте: man grep, man atoi, man chdir, man man.

Пролистывание вперед и назад делается кнопками «вверх», «вниз», «PageUp», «PageDown», выход из просмотра справки — кнопкой q. Поиск определенного текста в справочной статье: нажимите / (прямой слеш), введите текст для поиска, нажимите Enter. Перемещение к следующим вхождениям — клавиша n.

Все справочные статьи делятся на категории. Самые важные:

  • 1 — исполняемые программы и шелльные команды (wc, ls, pwd и т.п.);
  • 2 — системные вызовы (fork, dup2 и т.п.)
  • 3 — библиотечные функции (printf, scanf, cos, exec).

Указывать, из какой именно категории надо показать справку, нужно в случаях совпадений имен. Например, man 3 printf описывает функцию из стандартной библиотеки C, а man 1 printf — консольную программу с таким же именем.

Посмотреть список всех доступных на машине справочных статей можно с помощью команды man -k . (точка — тоже часть комады).

less

Когда в небольшом окне терминала надо просмотреть очень длинный текст (содержимое какого-то файла, длинный man и т.п.), используют специальные программы-«пейджеры» (от слова page/страница, то есть постраничные листатели). Самый популярный листатель — less, и именно он обеспечивает вам пролистывание, когда вы читаете man-ы.

Попробуйте и сравните поведение:

cat /etc/bash.bashrc 
cat /etc/bash.bashrc |less 

Можно передать файл в пролистыватель сразу в параметрах:

less /etc/bash.bashrc 

Пролистывание вверхи и вниз — кнопки «вверх», «вниз», «PageUp», «PageDown», выход — кнопка q. Поиск определенного текста: нажимите / (прямой слеш), введите текст для поиска, нажимите Enter. Перемещение к следующим вхождениям — клавиша n. (Узнаете инструкцию про man? Ничего удивительного, для вывода справки тоже используется less.)

Права

С любым файлом или каталогом связан набор «прав»: право на чтение файла, право на запись в файл, право исполнять файл. Все пользователи делятся на три категории: владелец файла, группа владельца файла, все прочие пользователи.

Посмотреть права на файл можно с помощью ls -l. Например:

> ls -l Makefile
-rw-r--r-- 1 akira students    198 Feb 13 11:48 Makefile

Этот вывод означает, что владельцу (akira) можно читать и писать файл, группе (students) — только читать, всем прочим пользователя — тоже только читать.

Если при работе вы получаете сообщение permission denied, это значит, что у вас недостаточно правна объект, с которым вы хотели работать.

Подробнее читайте в man chmod.

STDIN, STDOUT, конвейеры (пайпы)

С каждой исполняющейся программой связаны 3 стандартных потока данных: поток входных данных STDIN, поток выходных данных STDOUT, поток для вывода ошибок STDERR.

Запустите программу wc, введите текст Good day today, нажмите Enter, введтие текст good day, нажмите Enter, нажмите Ctrl+d. Программа wc покажет статистику по количеству букв, слов и строк в вашем тексте и завершится:

> wc
good day today
good day
      2       5      24

В данном случае вы подали в STDIN программы двухстрочный текст, а в STDOUT получили три числа.

Теперь запустите команду head -n3 /etc/passwd, должно получиться примерно так:

> head -n3 /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin

В этом случае программа head ничего не читала из STDIN, а в STDOUT написала три строки.

Можно представить себе так: программа — это труба, в которую втекает STDIN, а вытекает STDOUT.

Важнейшее свойство юниксовой командной строки состоит в том, что программы-«трубы» можно соединять между собой: выход (STDOUT) одной программы передавать в качестве входных данных (STDIN) другой программе.

Такая конструкция из соединенных программ называется по-английски pipe (труба), по-русски — конвейер или пайп.

Объединение программ в конвейер делается символом | (вертикальная черта)

Выполните команду head -n3 /etc/passwd |wc, получится примерно следующее:

> head -n3 /etc/passwd |wc
      3       3     117

Произошло вот что: программа head выдала в STDOUT три строки текста, которые сразу же попали на вход программе wc, которая в свою очередь подсчитала количество символов, слов и строк в полученном тексте.

В конвейер можно объединять сколько угодно программ. Например, можно добавить к предыдущему конвейеру еще одну программу wc, которая подсчитает, сколько слов и букв было в выводе первой wc:

> head -n3 /etc/passwd |wc |wc
      1       3      24

Составление конвейеров (пайпов) — очень частое дело при работе в командной строке. Пример того, как это делается на практике, читайте в разделе «Составление конвейера-однострочника».

Перенаправление ввода-вывода

Вывод (STDOUT) програмы можно не только передать другой программе по конвейеру, но и просто записать в файл. Такое перенаправление делается с помощью > (знак «больше»):

date > /tmp/today.txt

В результате выполнения этой команды на диске появится файл /tmp/today.txt. Посмотрите его содержимое с помощью cat /tmp/today.txt

Если файл с таким именем уже существовал, его старое содержимое будет уничтожено. Если файл не существовал, он будет создан. Каталог, в котором создается файл, должен существовать до выполнения команды.

Если надо не перезаписать файл, а добавить вывод в его конец, используйте >>:

date >> /tmp/today.txt

Проверьте, что теперь записано в файле.

Кроме того, программе можно вместо STDIN передать любой файл. Попробуйте:

wc </etc/passwd

Что делать, когда что-то непонятно

Если вы сталкиваетесь с поведением системы, которое не понимаете, или хотите добиться определенного результата, но не знаете, как именно, советую действовать в следующем порядке (кстати, это относится не только к шеллам):

  • насколько возможно четко сформулируйте вопрос или задачу — нет ничего сложнее, чем решать «то, не знаю что»;
  • вспомните, сталкивались ли вы уже с такой же или подобной проблемой — в этом случае стоит попробовать решение, которое сработало в прошлый раз;
  • почитайте подходящие man-ы (если понимаете, какие man-ы подходят в вашем случае) — возможно, вы найдете подходящие примеры использования команд, нужные опции или ссылки на другие команды;
  • подумайте: нельзя ли немного поменять задачу? — возможно, чуть-чуть изменив условия, вы получите задачу, которую уже умеете решать;
  • задайте свой четко сформулированный вопрос в поисковой системе — возможно, ответ найдется на Stack Overflow или других сайтах;

Если ничего из перечисленного не помогло — обратитесь за советом к преподавателю, опытному коллеге или товарищу. И не бойтесь задавать «глупые» вопросы — не стыдно не знать, стыдно не спрашивать.

Если вы разобрались со сложной проблемой (самостоятельно, с помощью Интернета или других людей) — запишите свое решение на случай, если такая же проблема снова возникнет у вас или ваших товарищей. Записывать можно в простой текстовый файл, в Evernote, публиковать в соц.сетях.

Методы работы

Скопировать-и-вставить — из man-ов, из статей на StackOverflow и т.п.Командная строка состоит из текста, пользуйтесь этим: копируйте и используйте примеры команд,записывайте удачные находки на память, публикуйте их в твиттерах и блогах.

Читать man. Nuff said.

Вытащить из истории предыдущую команду, добавить в конвейер еще одну команду, запустить, повторить.См. также раздел «Составление конвейера-однострочника».

Базовые команды

  • переход в другой каталог: cd;
  • просмотр содержимого файлов: саt, less, head, tail;
  • манипуляции с файлами: cp, mv, rm;
  • просмотр содержимого каталогов: ls, ls -l, ls -lS;
  • структура каталогов: tree, tree -d (можно передать в качестве параметра каталог);
  • поиск файлов: find . -name ...;

Аналитика

  • wc, wc -l;
  • sort -k — сортировка по указанному полю;
  • sort -n — числовая соритровка;
  • diff — сравнение файлов;
  • grep, grep -v, grep -w, grep '\<word\>', grep -E — поиск текста;
  • uniq, uniq -c — уникализация строк;
  • awk — в варианте awk '{print $1}', чтобы оставить только первое поле из каждой строки, $1 можно менять на $2, $3 и т.д.;

Диагностика системы

  • ps axuww — информация о процессах (запущенных программах), работающих на машине;
  • top — интерактивный просмотр самых ресурсоемких процессов;
  • df — занятое и свободное место на диске;
  • du — суммарный размер файлов в каталоге (рекурсивно с подкаталогами);
  • strace, ktrace — какие системные вызовы выполняет процесс;
  • lsof — какие файлы использует процесс;
  • netstat -na, netstat -nap — какие порты и сокеты открыты в системе.

Некоторых программ у вас может не быть, их надо установить дополнительно. Кроме того, некоторые опции этих программ доступны только привилегированным пользователям (root‘у).

Массовое и полуавтоматическое выполнение

На первых порах пропускайте этот раздел, эти команды и конструкции понадобятся вам тогда, когда доберетесь до несложного шелльного скриптинга.

  • test — проврека условий;
  • while read — цикл по строчкам STDIN;
  • xargs — подстановка строк из STDIN в параметры указанной программе;
  • seq — генерация последовательностей натуральных чисел;
  • () — объединить вывод нескольких команд;
  • ; — выполнить одно за другим;
  • && — выполнить при условии успешного завершения первой команды;
  • || — выполнить при условии неудачного завершения первой команды;
  • tee — продублировать вывод программы в STDOUT и в файл на диске.

Разное

  • date — текущая дата;
  • curl — скачивает документ по указаному url и пишет результат на STDOUT;
  • touch — обновить дату модификации файла;
  • kill — послать процессу сигнал;
  • true — ничего не делает, возвращает истину, полезна для организации вечных циклов;
  • sudo — выполнить команду от имени root‘а.

Составление конвейера-однострочника

Давайте рассмотрим пример реальной задачи: требуется прибить все процессы task-6-server, запущенные от имени текущего пользователя.

Шаг 1.
Понять, какая программа выдает примерно нужные данные, хотя бы и не в чистом виде. Для нашей задачи стоит получить список всех процессов в системе: ps axuww. Запустить.

Шаг 2.
Посмотреть на полученные данные глазами, придумать фильтр, который выкинет часть ненужных данных. Часто это grep или grep -v. Клавишей «Вверх» вытащить из истории предыдущую команду, приписать к ней придуманный фильтр, запустить.

ps axuww |grep `whoami`

— только процессы текущего пользователя.

Шаг 3.
Повторять пункт 2, пока не получатся чистые нужные данные.

ps axuww |grep `whoami` | grep '\<task-6-server\>'

— все процессы с нужным именем (плюс, может быть, лишние вроде vim task-6-server.c и т.п.),

ps axuww |grep `whoami` | grep '\<task-6-server\>' | grep -v vim
ps axuww |grep `whoami` | grep '\<task-6-server\>' | grep -v vim
|grep -v less

— только процессы с нужным именем

ps axuww |grep `whoami` | grep '\<task-6-server\>' | grep -v vim
|grep -v less |awk '{print $2}'

— pid-ы нужных процессов, п. 3 выполнен

Шаг 4.
Применить подходящий финальный обработчик. Клавишей «Вверх» вытаскиваем из истории предыдущую команду и добавляем обработку, которая завершит решение задачи:

  • |wc -l чтобы посчитать количество процессов;
  • >pids чтобы записать pid-ы в файл;
  • |xargs kill -9 убить процессы.

Задания для тренировки

Хотите попрактиковаться в новых умениях? Попробуйте выполнить следующие задания:

  • получите список всех файлов и каталогов в вашем домашнем каталоге;
  • получите список всех man-статей из категории 2 (системные вызовы);
  • посчитайте, сколько раз в man-е по программе grep встречается слово grep;
  • посчитайте, сколько процессов запущено в данный момент от имени пользователя root;
  • найдите, какая команда встречается в максимальном количестве категорий справки (man);
  • подсчитайте, сколько раз встречается слово var на странице ya.ru.

Подсказка: вам понадобится find, grep -o, awk '{print $1}', регулярные выражения в grep, curl -s.

Что изучать дальше?

Если командная строка начинает вам нравиться, не останавливайтесь, продолжайте совершенствовать свои навыки.

Вот некоторые программы, которые определенно вам пригодятся, если вы будете жить в командной строке:

  • awk
  • sed
  • find со сложными опциями
  • apropos
  • locate
  • telnet
  • netcat
  • tcpdump
  • rsync
  • screen
  • ssh
  • tar
  • zgrep, zless
  • visudo
  • crontab -e
  • sendmail

Кроме того, со временем стоит освоить какой-нибудь скриптовый язык,например, perl или python, или даже их оба.

Кому это надо?

А стоит ли вообще изучать сегодня командную строку и шелльный скриптинг? Определенно стоит. Приведу только несколько примеров из требований Facebook к кандидатам, которые хотят поступить на работу в FB.

Data Scientist, Economic Research: Comfort with the command line and with Unix core tools; preferred: adeptness with a scripting language such as Python, or previous software engineering experience.

MySQL Database Engineer: High degree of proficiency in Shell scripting (Bash, Awk, etc); high degree of proficiency in Linux administration.

Manufacturing Quality Engineer, Server: Scripting skills in Bash, Perl, or Python is desirable.

Data Platform Engineer: 2 years experience with Unix/Linux systems.

DevOps Engineer, Data: 2 years experience with Unix/Linux system administration and programming.

Вопросы?

Если у вас есть вопросы по этой статье или вообще по работе в юниксовой командной строке, задавайте их в комментариях или по емейлу liruoko (at) yandex (dot) ru.

Немного полезных и интересных ссылок

15 интересных команд Linux

Survival guide for Unix newbies

Интересные приемы программирования на Bash
оригинал: Better Bash Scripting in 15 Minutes

Shell programming with bash: by example, by counter-example

Простые способы сделать консольную утилиту удобнее

Debug your programs like they’re closed source!

		 ���������������� �� shell (UNIX)
		       (������� �������)

(�) �. ��������

			 1. ��������

     ����� ������������ ������ ������ ����� �������� Unix.
     ���������������  ��������  ��,  ���  ��  Unix ����� ��������
�����������  ��  ��  ����  �����������  ����������.  UNIX  -  ���
��������  ��  �����  ��������  �  ��������� ������������� ������.
(��������� �������� UNIX ������������� ��������� AT&T - ���������
������  ����������  ��������:  SCO  UNIX,  BSDI,  Solaris, Linux,
DG/UX, AIX � �.�.).
     ���  ��  ������  �������������,  ��  � ���������������������
�������.  ��� ������������ ����������� ���������������� ���������
��  ���� �������  X Window � ����������� ����� �� ���� ����������
TCP/IP � �.�.
     �� Unix ���� ������� ����� ��������� � �������� ����� � Bell
Laborotories  (AT&T).  ������ ���������������� Unix/v7 (������ 7)
������  �  79  - 80-� �����. �������� ���������� Unix � 1983 ����
�������������   ������   �.��������  �  �������  ����������������
������������  ���������  ����  �������  ������� ������� (computer
science) ���������������. ��� ����� ��������������.
     �������  ������������  ������ ������ � ����� �� ������������
���������� �� ����� ������������� UNIX!

     ��  Unix  �����  ��  ����  �����: ���� ��, �������� �������,
���������  ����. � ���������� � ��� ���������� ������� X Window �
��������� TCP/IP.
     ����  ��,  ��  ������� �������� ���� ������������ �������, �
�����  �������,  ��������  � ���� �������� ����� �������� ������:
��������  �����, ����������� ��������� if, for, while � �.�., � �
������   -  ��������  ��������,  ��������  ������  ������  ������
����������:    �����������   ����������,   ��������   (���������)
����������, ����������� ������ � ������ ��� � ���������� ������ �
�.�.

		     2. �������� �������

     ��������  �������  �� Unix ����� ������������� (�����������)
���������. � �������� ������ ��������� �������� (���������� �����
������� - �����������, ����������), ���������� ������ ������. ���
�����  �  ����  �������  �����  ����  ���� ����� ����������, ����
��������  �������,  ����  ������������  �������,  ���������������
��������� ��������� �����-������.

			  /
			  |
   -----------------------------------------------------------
  |     |     |    |    |    |    |                 |    |     |
bin    boot  dev  etc  lib  mnt  sys    .   .   .  tmp  unix  usr


     K������� ������� ����� ��� "/". �� ������ �������� ��������:

     bin - ��� �������� ������������ ������;
     usr  -  ��������  �  �������  �����,  ���������� ����������,
������������ ��� ������� ����� ������������;
     dev  -  ���  �����������  ������,  �������������� ����������
(�������, �����...);
     etc - ��� �������� ������ �������������� �������;
     lib - ��������� ����������;
     mnt  -  ���  �����������  (���������������)  �����  ��������
������;
     sys - �������� ��� ��������� ������������ �������;
     tmp - ��� �������� ��������� ������;
     usr  -  ��������  �  �������  �����,  ���������� ����������,
������������ ��� ������� ����� ������������.

� ����� ������� (�����������) �����:
     unix - ����;
     boot - ���������.

     ������ ����� ������ �����: /bin, /usr, ..., /unix, /boot.

     �   ����  �������  ���  ��������  �����  ���������  ��������
����������   ������.  ��������,  �������  "usr",  �����  �������,
�������� ��������:
     bin - ������ �������������� �������;
     games - ����;
     include - ������ ��������� ��������� ��������;
     lib - ������ �������������� ����������.
������ ����� ���� ������ �����:

     /usr/bin   /usr/games   /usr/include   /usr/lib

     ����  �  ��������  "/usr/include"  ���������� ������� "sys",
�������  �  ����  �������, �������� ������� "conf", �� ������ ���
����� "conf" �����

     /usr/include/sys/conf

     ����������  ���������  �������  �����  ��������  ��, ��� ���
���������� �� ����� ("/").
     �������������  ���  ����������  ��  �  "/",  � ��������� ���
������������  ������ ��������������. ���� (�����������?) � ������
������  ��������� � ���������� /usr �������� �������, �� �� �����
���������� � ����� �� ����� �� �������������� �����

	 include/sys/conf

     ����  ���  �����������  �����:
     .   -  ��� "���" �������� ����������  �
     ..  -  ��� "���" ������������� ���������� (�.�. ����������,
������������ �� ��������� ���� ������� �� ���� � �����).
     �  ��������  �����  �����  ���  ������� ����� ��������������
�����  �������������������  ��  ����, ���� � �������������. �����
��������������  �  ������  �������,  ������ ��� ���� �������� ���
�������������� � ����� ������� ������������ �������������. (�����
��  ������������  ������������  ���������  �  ������ - ������ ���
����� �������� � ���������� � ��������� � ����� ������, ���������
����������� ����� ����� � shell ��������� ����������� �����).
     �  ����  ������  �����  �����  �������������� 14-� ���������
(�����  �����������  ����������  �������������� ��� �������������
������), ������ � ������ �������� ����������� ����� ������� �����
- ��������, �� 256 ��������.
     �   �����   ������   ��  �������  �������������  �  �����-��
����������  �  ������.  ���� ��� ������ ������� ������� ���������
�������������  ����������  � ������, �������� ���������� ".�" ���
�������� ������ ��� ��-�����������.
     ������.  �  �� UNIX ������� � ��������� ����� ��������������
���  ���������,  �������  "FILE",  "file"  �  "File"  -  ���  ���
��������� �����!

     ������  ���������.  ���������  �����  �������� ������� �����
����������  ��  ���������  ����������  �����������,  ��������, ��
���������� ������� � ������ ������ (��� � ��������� ������ ������
�����).  ��������������  ���������  (���������� �������� �������)
�����������  (��������������)  � ������ �������� ������� ��������
mount  (������  ���  �������  �������������� �������), ����� ����
������������  ����� ���������� � ����� ��������� ������, ��� ����
� ����� ����� �� ���������� ����������, �� ������� ���� ���������
��� ��������� (�.�. ������� "A:").

     ���������  ���� �� Unix - shell ��������� � ���������. �����
�������� � ��� �������� �����, � ���� ���������� ��������� ������
������ � �������� ��������.
     ��������, � ���������� ���������� �������

	    ls -l /usr

     ��� ls - ��� �������; -l - ����, ��������� � ���, ��� ������
������  ����  � ������� �������; /usr -��� ��������, ������� ����
echo. �� ����� ����� ��������

    drwxrwxr-x  2  root  2048  nov 3  12:11  bin
    -rwxr--r--  1  root   861  may 11 20:11  boot
    drwxrwxr-x  2  root  1024  jan 9  11:55  dev
    drwxrwxr-x  1  root  4096  may 11 20:11  dos
    drw-r--r--  3  root  4096  nov 17 12:01  include
    drwxr-xr-x  7  root  480   nov 17 12:30  lib

     ������  ������  ��������, ��� ��� ������� (d-directory), ���
������ ������ "rwx" ��������� ��������� ��������: r - ������, w -
������  �  �  - ��������� (����� �����, ��� ������ ���� ������� w
��������  ����������  ���������  ����� � �������� � ������� �� ��
����,  �  � ��������� ������ � ������ ��������); ������ ������, �
�������  ������  ��������,  �����  ���������  ���  ���  ��������.
���������  ������  ��������  �����  ������� ������ �������������,
�������  ���������  ������ ������ � ��������� (��������� ������ �
���� ����, �.�. �������� ���������� ��������).
     �����,  2  -  ���  ����� ������ ����� (�.�. ���-�� � �������
����  ���  ����  ���,  ���������  �  ����  ������);  root  -  ���
���������,  2048  -  ����� �������� � �����, nov 3 12:11 - ���� �
�����  ��������  ���  ���������  �����������  �����  (3  ������ �
12-11); bin - ��� ����� (������� ������).
     �� ������   ������  ������  �������  ���������  ���� (boot),
������� ������ ������������ ����� ������ ������.

     �������   "pwd"   (���   ������   �   ����������)   ��������
��������������  ������������  �  ��������  �������.  � �� �������
��������� ������ ��� �������� ��������.
     ���  ����� � ������� ������������ ����������� � ������������
�������  �������  ������.  �����,  ��������,  ���  �����  �������
"/usr".
     ��������  ��������������� ����� �������� "cd <�������>". ���
����� ������� � ������� /usr/include/sys, ������ �������

	cd  /usr/include/sys

����� ������� ������ ��� , ���

	cd  include/sys

����� ������� ������������� ���.
     �������������  �������  ��������������  �����  -  ����������
������� "/" � ������.
     �������  "cd  .."  ����������  �������  �����  �� ����������
�������.    ��    "/usr/include/sys"    ����������    �������   �
"/usr/include",  �  �������  "cd" (�.�. ��� ����������) ���������
�������  �  ��������� ���������� ������������ (�.�. ����������, �
������� ������������ ����������� ��� ����� � �������).

     ������� ����� �������� ����� � ������� �������

     mkdir <����� ����������� ���������>

     ���  �������  "mkdir  err new" ������� � ������ �������� ���
����� �������� � �������������� ������� "err" � "new".
     �������  ������  (��  ����������  ������)  �������  �����  �
������� �������

     rmdir <����� ��������� ���������>

     ������� ������� ���� ����� ��������

     rm <����� ��������� ������>

     ��������   ������������  ���  ������������  ������  ��������
������   -   ���  �������������  ����������  ���������  "ed"  ���
���������  ���������  "red" (� ����� ����������� "vi" � "��", ���
�������������� ������ "���������").
     �  ��  Unix  �����  200  �������  ������  - ����������������
�������, ����������� ������������ ������ ������ ���� ��������, ��
��������  �  ���������������� �� ������ ���� �� ��� �������������
����������� �������.

     ��������

     rm ����-1

����� ������� "����-1".

    ��������

    rmdir ����-1

     �����  �������  "����-1", ���� ��� ����������, ������ ������
(�.�. �� �������� ������).

     ��������

     mv ������-��� �����-���

����� ����������� ����.

     ��������

     cp ������-��� �����-���

����� ����������� ���� (�������� ����� ������).

     ����� ����� �������

     chmod 755 ������

     �������   ����������   ����   "������",   ��������������   �
���������,  �  ���������,  �����  "������"  ��� ������� ������ ��
�����  ����������. ����� ���� ����� ������������ ������� ��������
�������������  ������������ ����� � ������� ���� ������� � ������
(rwx  -  ������,  ������,  ����������).  ��  ���� ����������, ���
��������� ������� ����� �� ������ ��������� ��� ����������� �����
�����  �������,  ��  �  ������� � ���� ��������� (7:111 - rwx). �
�����   ������   �  ������  ������������  ����  ������  ������  �
���������, �� �� ����� �������� ���� ������ (55:101101 - r-xr-x).


		  3. ���������� �������� SHELL

     ���������  ����  shell  (�  ��������  -  ��������, ��������)
����������  ����  ���� ���������������� ����� �������� ������. ��
����  �����  ������������  ������������  ����������  �����������.
������,  �����  �����  � ������� �� ��������� ����������������� �
��������� ��������� (���� ������ - ��� �������� �����������������
�  ����).  ���������  ����,  ��� �������� (shell) ������ � ������
������  ������  ����������  ��  ��  �����  ��������. � ����������
������ ��� ���� ������ ("$").
     Shell  ��  ��������  �����������  �  ������������  ���������
������  (����  ������  ��  ��������������  �  ������ POSIX [POSIX
1003.2]   -   ���������   ���������  ������).  ��������,  �������
�������������  ���������� ���� cshell, ���� ����� kshell, bashell
(��  �������� ���������� � ��������� �����) � ������. ����� ����,
������  ������������  �����  �������  ����  ��������� ����. �����
������������  �� ����� ���������� ������������ ������� �������� �
������� ���������� �������.
     ��������  ��������.  shell - ��� ���� �� ������ ������ UNIX.
��  ����  � ����� ������ �������� (��������������) "shell" ������
�������  "sh"  -  �����  ��������������  "shell".  ������ "shell"
����������  �������������  ���  ����� ����� � ������� � ������ ��
����� �������. ����� ����� �� ������ �������� �� ���������� �����
�������,  �  ���  �����  � ����� ��� "shell", ������� ��� �������
����� �������� ������ �������.
     ��� ��������, ���� �� ����������� � ��������� ���� "f1":

     echo Hello!

     ��  ���  �����  �������  ���������  ����, ���������� �������
"echo", ������� ��� ���������� ������ ��� ���������� ������ �� ��
�����.  �����  �������  ����  "f1"  ����������� � ������� �������
"chmod  755  f1". �� ��� ����� ���������, ������ ���� ������� (!)
"sh" ("shell"):

     sh f1

���

     sh < f1

     ����  �����  ���������  �  � ������� ���������� "shell". ���
����� ���������� ������������� ������� "." (�����), �.�.

     . f1

     ������   ��������������.  ��  ���������  ���������  �����  �
�������  "#", ���� ����������� �������� ��� � �����������. ���� �
���,  ���  �����  ��������� ���� � �������� C-Shell ("csh") �����
���������������  ���  �����������  �  "csh",  �  ���������� �����
�������������. ������������� "csh".
     �����.  ���������  ���������  sh-����  �  ������  ������ ���
������� ��������� ":".
     ���������  UNIX  -  ������� ���������������������, �� ������
����  �� ������������ ���������� �������� �����������, ������, ��
12-��  �������  (�������  �  ������  ��  ����� ALT/��������������
�������),  ����  ��  ������  ������ ������ (��� ������ � ���� ��)
������������ �� ����� ��������� ���������. ������ � � �����������
������ X-Window ����� ������� ������� ����� ����, � � ������ ����
����� ���� ���� ���� ������������ �� ����� ��������� ���������...
     ���������� ��������� ����� shell �������� �������.


		  3.1. ��������� ������

     ������� � shell ������ ����� ��������� ������:

     <��� �������> <�����> <��������(�)>

     ��������:

     ls  -ls  /usr/bin

     ��� ls - ��� ������� ������ ����������� ����������,
     -ls  - ����� ( "-" - ������� ������, l - ������� ������, s -
��'�� ������ � ������).
     /usr/bin -  ����������, ��� �������� ����������� �������.
     ���  �������  ������  ��  ����� � ������� ������� ����������
����������  /usr/bin,  ���  ����  �������  ����������  �  �������
������� ����� � ������.
     � ���������, ����� ��������� ������� ������������� ������ ��
������.  ��  ������ ����� ������� �������� �����, �� ������ �����
����   �����   ������.   ����   ������������  �  �  �������������
����������.   �   �����  ������,  �������  ������������  �������,
���������  � ����� "�������" �������, ��� ��, tar, dd, find � ���
������.
     ���    �������  (��   ��   ������),   ������   �����   (�.�.
������������������  ��������  ��  �������,  ���������  ���  �����
������)  shell ������������,  ���  �������.  �������  � ���������
������

     cat cat

     ������   �����   �����   ������������  shell,   ���  �������
(������������),  �������   ������  ��  �����  ���� � ������ "cat"
(������ �����), ����������� � ������� ����������.


		   3.2. ����������� ������.

�������� �����������:
     ;   �   <�������   ������>   -  ����������  ����������������
���������� ������;
     & - ����������� (�������) ���������� �������������� �������;
     &&  - ���������� ����������� ������� ��� ������� �����������
���������� ����������, ����� ������������;
     ||   -   ����������  �����������  �������  ���  ������������
���������� ����������, ����� ������������.

     ���  ����������  ������� � ����������� ������ (����� �������
�����   ����   ���������)  ��  �����  ���������  �����  ��������,
���������������  �����������  �������,  �  �������, �������� ����
������� �������, ����� ������� �� ������ � �������������.
     ��������,  �������  (������������)  ������� "find" � �������
������  ���  ������  �  �������  ,  ������� �� ����� "/", ����� �
������  "conf",  �  �����  "pwd" � ������� ������. �� ������ ����
�������� ����� ��������� ��������� �������:

--------------------------------
| $ find / -name conf -print & | ���� ������� "find"
|                              |
| 288                          | ����� (PID) �������� ��������
|                              |
| $ pwd                        | ���� ������� "pwd"
|                              |
| /mnt/lab/asu                 | ��������� ������ "pwd"
|                              |
| $                            | ����������� shell � ��������
|                              |
| /usr/include/sys/conf        | ��������� ������ "find"
|                              |
--------------------------------

     ������  ����������,  ����� ��� ������� �������� �����������,
������  ���  �����  ����������� �����-�� ������. ��� ����� ������
�����������  �������  "wait  [PID]".  ��� ������� ���� ����������
����������   ���������������  (������)  ��������  ��������.  ����
�������  ���  ���������,  ��  ���  ����  ����������  ���� �������
���������, �������� ��� ������� "sh".

     ���  �����������  ������ ����� ����� �������������� ��������
"{}"  �  �������  "()"  ������.  ����������  �������,  ����������
��������� ������� �����������:

     ���� ������� ��������� ������

     k1 && k2; k3

     ���  k1, k2 � k3 - �����-�� �������, �� "k2" ����� ���������
������  ���  ��������  ����������  "k1";  ����� ������ �� �������
���������  "k2" (�.�. "k2" ����� ���������, ���� ���������) �����
��������� "k3".

     k1 && {k2; k3}

     �����  ���  ������� ("k2" � "k3") ����� ��������� ������ ���
�������� ���������� "k1".

     {k1; k2} &

     � ������� ������ ����� ����������� ������������������ ������
"k1" � "k2".

     �������   ��������   (���   �   �������   ���������)  ������
����������,  ���������  ������������  �������  "CTL/C"  ���������
������   ��������   ���������  �����.  ���  �����������  ��������
��������  ����  ����� ��� �����. ��� ������� �������� �������� ��
�����  ��������  �����,  ���������������  ������ (��������������)
�����  ��������  (PID). ���� ���� ����� ����� ��� ���� ���������,
��� ���� ������� �� ��������, � ������� �������

	ps -aux

     �����  ��������  ��������  ���������������  ��������� (PID),
�����  �������������,  �������  �����,  ����������� ����������, �
�.�.
     �   ����������   �������   �����   �����  ������  ���������,
����������   �����������,  ��������  ���  "849"  �  "866".  �����
��������

	kill -9  866 849

     �����  ����������  ���  ��������.  ��� ����������� ���������
���� �� ������ ����� �� �� ��� ������������, ����� ���� ���������
������������   ���������   (���   �����   ���  ������������������
������������).

     ��������������.    ����   �����������   ��������������   ���
���������  ���� � ����� ������ (��������, ��������� �������������
�������  �  ��������  ���� � ��� �� ����), �� � ������� ���������
�������������  ���  �������  �����, ������� ��������� (�������) �
�������  ���������.  ��� ������ ������ ������������� ������������
�����������,   �������   �����������   ����  ����  �����������  �
���������� �������.

     �������  ������  "()", ����� ���������� ������� �����������,
���������  �  �������  ������  ������  ����������  ��������������
shell.
     ����� �� ���������� � ��������� �������� "/mnt/lab/asu"
     ����� � ������������������ ������

     cd ..; ls; ls

     ���  �������  "ls" ������� 2 ���������� ����������� ��������
"/mnt/lab", � ������������������
     (cd ..; ls) ls
     ������  �������  ����������  ��������  "/mnt/lab",  �  �����
����������  "/mnt/lab/asu",  �.�.  ���  ����� � ������ ����������
�����   ���������  shell,  �  ������  ��������  �  ��������������
�������. ��� ������ �� ������� ������ ���������� ������� � ������
shell � � ������ �������.


		   3.3. ��������������� ������

     ����������� ���� (����) - "stdin" � �� UNIX �������������� �
����������  ���������,  �  �����������  �����  (�����) - "stdout"
���������  ��  ����� ���������. ���������� ��� � ����������� ����
���������������  ���������  - "stderr", � ������� ���� ����� ����
�����.
     �������,  �������  �����  ��������  ��  ����������� ������ �
�������, ���������� ��������.
     ������������  ����� ������� �������� ��������������� ����� �
������   ��   ������  �����  (����������).  �������  ">"  �  ">>"
���������� ��������������� ������.

	ls >f1

     �������  "ls"  ����������  ������ ������ �������� �������� �
�������� ��� � ���� "f1" (������ ������ �� �����). ���� ���� "f1"
�� ����� �����������, �� �� ����� ������ �����.

     pwd >>f1

     �������  pwd  ����������  ������  ���  ��������  ��������  �
�������� ��� � ����� ����� "f1", �.�. ">>" ��������� � ����, ����
�� ��������.
     ������� "<" � "<<" ���������� ��������������� �����.

     wc -l f4   �   wc -l >f4  f2

     ������  ��������  ��  ����� "f1" ("cat") ������� ��� ������,
����������   �����   "result"   ("grep"),   �����������  ("sort")
����������  ������,  �  �����  �����������  ("cat  -b") � �������
��������� � ���� "f2".
     ���������  ����������  �  ��  UNIX ������������ ������������
�������,  �� ����� ������������ ��� ����������������. �����������
�����  ���������  �  ��������  "/dev".  ��������,  "lp" - ������;
"console"  -  �������; "ttyi" - i-�� ��������; "null" - ���������
(������) ���� (����������).
     �����,  ��������,

     ls > /dev/lp

     �������  ����������  �������� �������� �� ������, �

     f1 < /dev/null  �������  ���� "f1".

     sort f1 | tee /dev/lp | tail -20

     �  ����  ������  �����  ������������  ���� "f1" � ������� ��
������, � 20 ��������� ����� ����� ����� ������ �� �����.

     ��������  �  ��������������� ������. ����������� ����� �����
������:  0  -  stdin,  1  -  stdout  �  2  -  stderr. ���� ��� ��
����������  �����  ��  ������  ���������  ��  ������,  ��  ������
�������������  ���  �  ������  �  ��������� ���� ���� (��� ������
"���������",   ������������   �   ����   "�������  ����������"  -
/dev/null). �������� ��� ���������� �������

     cat f1 f2

     �������  ������  ������  �� ����� ��������������� ����������
������ "f1" � "f2", ������ ���, ��������, ���������

    111111 222222

    cat: f2: No such file or directory

��� 111111 222222 - ���������� ����� "f1", � ���� "f2" �����������,
� ��� ������� "cat" ������ ��������� � ����������� ���� �����������,
�� ���������, ��� � ����������� �����, �������������� �������.
     ����  ��� �� ���������� ����� ��������� �� ������, ��� �����
������������� � ��������� ���� ����:

     cat f1 f2 2>f-err

     ���������  ��  �������  �����  ������������ (�� ���� �������
���������������  "2>")  �  ����  "f-err".  ������,  �� ������ ���
����������  ����������  �  ����  ����  "ff", ����������� � ������
������ �����������

     cat f1 f2 >>ff 2>ff

     �����   �������   ��  ������  �����  ��  �����������  ������
��������������,   ��  �  �  �����  �����������  ����  �����������
���������������.

     cat f1 f2 2>>ff 1>&2

     �����    �������   "stderr"   ����������������   (�   ������
����������)    �   ����   "ff",   �   �����   �����������   �����
����������������  ��  "stderr",  ������� � ����� ������� ��������
���� "ff". �� ���� ��������� ����� ���������� �����������.
     ����������� "1>&2" - ��������, ��� ����� ������ ������������
�����,  � ������� �������������,  ���������� ������� ������� "&";
��� ����������� ������� ��� ��������.
     <&-   - ��������� ����������� ����.
     >&-   - ��������� ����������� �����.


	  3.4. ��������� ���� ������.

     ��� ��������� ���� ���������� �����������:
     *   -   ������������  (��������  ������)  ������������������
��������;
     ? - ���� ������������ ������;
     [...] - ����� �� ��������, ��������� � ������� �������������
�/��� � ��������� ���������;

     cat f* - ������ ��� ����� ��������, ������������ � "f";
     cat *f* - ������ ��� �����, ���������� "f";
     cat   program.?   -   ������   �����   �������   ��������  �
�������������� ������������, ������ "program.c" � "program.o", ��
�� ������ "program.com";
     cat  [a-d]*  -  ������ �����, ������� ���������� � "a", "b",
"c", "d". ����������� ������ ����� � ������� "cat [abcd]*" �
"cat [bdac]*".


		  3.5. ��������� �����.

     ���  ����,  ����� ��������� ���� ����� ���� ������������ ���
�������, ���������� ��������� ������������.
     �����  �  �������  ���������  ������  ����  �  ������ "cmd",
���������� ���� ������ ���������� ����:

     date; pwd; ls

     �����  �������  shell  ��� ������� (!), ������������ "sh", �
��������  ��  ���� "cmd",  ���  �������� ��� ��� ����������������
����, �.�.

      $  sh cmd    ���     $ sh . ��������� ���� �����
��������������   ��   ��  ���  �����,  �  ���  ������������������
��������(!).  �����������  ��  ���������, ��� �� �����. ������� �
��������  ��������  ����������  �����  ���������  ����� ���������
�����������  ���  ������  �������  ,  ���  �������� ������
������.  (��� ����������� �������� ������� ����� ������� ��������
���� �������).

     ���  ���������  �  shell-����������  ���������� ����� ������
������� ������ "$". ��� �������

     echo $var_2
     echo var_2

������� �� �����

     �� UNIX
     var_2

     � ��� ���� ������. �������� ���������� �����:

     echo "var_2 = $var_2"

������ �� �����

     var_2 = �� UNIX

     �  �������  "echo" ������ ������������� "var_2" - ��� ������
�����,   �  ������  ("$var_2")  -  ���  ��������  ���������������
����������.
     ��  ��� ����� ������������ ������� ����� ������ ���������� �
��������  ������������,  �  �����  �����  �������� ������������ �
���������,  ���  ���  ������,  ���  �����  ��  �����  ���� ���� �
�������,   ����   �����������   ��������   ����������.  ���,  ���
�������������  �����������  ������������,  �������  � ���� ������
�����������.   ������������,  ������,  w=  ��������  ������������
����������   "w"   ������   ������.  ��  �  ������  ������  �����
����������� ���������, �������� w="".

     ���  ����,  �����  ���  ����������  �� ��������� �� �������,
��������� �� ������ ����������, ������������ �������� ������.
     �����  a=/mnt/lab/asu/

�����

     cat /mnt/lab/asu/prim

�

     cat ${a}prim

     ����������  (�.�.  "cat" ������ �� ����� ���������� ������ �
���� �� �����).
     ����  �����  ������������,  ���  �  �������  ���� ����������
"prim" � "prim=dir" , �� �������

     echo ${a}$prim

������ �� �����

     /mnt/lab/asu/dir


		  4.2. �������������

     ���������� ����� �������� ������ �������������, ������������
�  shell.  �  �������� ������� ������������� ������������ �������
������� (" "), ��������� ������� (' ') � ���-���� (\).
     �� �������� �������� �� ��������:
     �����  �  �����  ������  ����������  ��������� ���c��������.

     x=22 y=33 z=$x
     A="$x" B='$x' C=\$x
     D="$x + $y + $z"  E='$x + $y + $z'  F=$x\ +\ $y\ +\ $z

     (������������ G=$x + $y �� ���� �� ��������� ��-�� ��������)

     �����

     echo A = $A   B = $B   C = $C
     echo D = $D   E = $E   F = $F
     eval echo evaluated A = $A
     eval echo evaluated B = $B
     eval echo evaluated C = $C

     ������� �� �����

     A = 22 B = $x C = $x
     D = 22 + 33 + 22 E = $x + $y + $z F = 22 + 33 + 22
     evaluated A = 22
     evaluated B = 22
     evaluated C = 22

     ��������. � ���� ��������� ������� ������������ ������������
�������   "eval"   (��   evaluate   -   ����������),   �������  �
�������������  �  ���  (� ��������  ���������) �������  ���������
�����������  ����������  (����  �������  �������).  �  ����������
�������� "A" �������� �������, ��������� "A" ����� �������� "22".
�  ���������� "B" � "C" ����� �������� "$x". �� ���� �����������,
������� ���� ��������� �������� "eval" - evaluated "B" � "C" ����
�������� "22".
     ��� ���� ������ �� "eval".
     �����

     w=\$v v=\$u u=5

     � ���������� ���������� ������

	       echo $w
	  eval echo $w
     eval eval echo $w

     �� ����� ����� ��������

     $v
     $u
     5

     ��������  ���  �������,  ��������� � �������������� ��������
������.  �����  ����������  "string" ��������� �������� "�������"
2x3:

abc
def

     ������  ��������,  ���  ���  ���������  ������������  ������
��������  ������ ������ ������� ������ � ������ ������� ���������
������:

string="abc
def"

����� ��� �������� ������ ���������� � ������� "echo"

echo  $string
echo '$string'
echo "$string"

����� ������������� ��� ��������� ����������:

abc def

$string

abc
def

� ������������������ ������

echo "������ ������
������ ������" > f1

echo '������ ������
������ ������' > f2

cat f1 f2

���� ������ ��������������� ���������� ����� f1 � f2:

������ ������
������ ������
������ ������
������ ������

     �������   �����,  ���  ���-����  (\)  ��  ������  ����������
���������  ��  ��� ������, ��� ��������� ������������ �����������
�������  ������  ���  �������, �������������� ���� ���� (�� �����
������������  �  ���  ����  -  \\), �� � ��������� ����� ���-����
��������� ��'������� ������ � ���� (������������ ����� ������).
    ��������, ������������� ����� ������ ��������� ������:

     cat f1 | grep -h result | sort | cat -b > f2

����� ���� ������� � ��������� �����, ������, ���

     cat f1 | grep -h  \
     result | sort | cat -b > f2

     ������,  ������  ����������� ��������� ������ ������������ �
������   ���������.   �   ������  ������  ���  �����  ����  �����
����������� ���������, ��������:

     cat f1         |
     grep -h result |
     sort           |
     cat -b > f2


	       4.3. ����������� � shell-�����������

     ��������   ��   ��,  ���  shell-����������  �  �����  ������
��������������  ���  ������, �.� "35" - ��� �� �����, � ������ ��
����   ��������   "3"   �   "5",   �   ����   �������  ���  �����
������������������ �����, ��������, ��� ����� �����.
     �������������     �����������    �����    �������    "expr".
     ��������������� ��������� �� ��������:
     ���������� ���������� �����:

     x=7 y=2
     a=`expr $x + $y`   ; echo a=$a
     a=`expr $a + 1`    ; echo a=$a
     b=`expr $y - $x`   ; echo b=$b
     c=`expr $x '*' $y` ; echo c=$c
     d=`expr $x / $y`   ; echo d=$d
     e=`expr $x % $y`   ; echo e=$e

������ �� �����

     a=9
     a=10
     b=-5
     c=14
     d=3
     e=1

     ��������.  ��������  ��������� ("*") ����������� ������ ����
��������������, ��������� � shell ���� ������ ��������������, ���
����������,  ����������,  ��� �� ��� ����� ����� ���� �����������
����� ������������������ ��������.
     �������  ��������  �����  ��������  �� ������������ �������,
���������� ���������� � ����� ��������.

     �   ��������   "expr"  ��������  ��  ������  (�������������)
�������������� ��������, �� � ���������:

     A=`expr 'cocktail' : 'cock'`  ; echo $A
     B=`expr 'cocktail' : 'tail'`  ; echo $B
     C=`expr 'cocktail' : 'cook'`  ; echo $C
     D=`expr 'cock' : 'cocktail'`  ; echo $D

     ��   �����   �����   ��������   �����,   ������������  �����
�����������  ��������  � �������� (�� ������). ������ �� ����� ��
����� ���� ������� ������ :

     4
     0
     0
     0

     � �������, �� �������� ������ �����������.
     ���� ����������, ������ "�", "y", "z", �� ����������, �� ���
��������� � ����������
     ${x-new} - � �������� �������� "x" ����� ������ "new",
     ${y=new} - � �������� �������� "�" ����� ��������� "new",
     ${z?new} - � �������� �������� "z" ����� ������ "z: new" �
��������������� ��������� ������������.
     ��  ����  ���� �������, ���� ���������� ���� � ����� �������
����������, �� �� �������� ������������ ������� �������.
     �  �  ���������  ������ ��������, ����� ���������� "v" �����
�����-�� ��������, �����
     ${z+new}  -  �  ��������  �������� "z" ����� ������ "new", �
���� �� ���� ��������� ��������, �� ������ ������.


		    4.4. ������� ����������

     �  ��  UNIX  ����������  ������� ��������. ������� ���������
�����,   �����   �����������  ��  ����������  �����-����  �������
(������).
     ��������,  ���  ������ �� ���������� "� " �����������
�������  �������  "�".  �  ���� ������� "�" ����� �������� ������
��������. ��������, ��� "�" �������� ������� "�1" � "�2", �������
��������������� ��������� �������������� ��������.
     � ������� �������� ���� ���� ����� - ��������� ��������� ���
����������.  ��������,  ��  �������  ������� "�" ��� ������������
�����,  �  �������  ���  ����  ���������� ��������� ���������� (�
�����������  ����������  ���� ������ ��������� �����). ������ "�"
���������  �����  �����; ��� � ��� ����� ��������� ������� "�1" �
"�2".
     ����������   ��������  �  ������  ��������,  �  �������  ���
���������,  �.�.  ���  �� ��������� �������� (�������� ����������
����������  -  ���  ���  ������  ����).  ��� ����, ����� ��� ����
��������  �  ������ ����������� ���������, ���� �������� �� �����
�������. ��� ����� ������������ ���������� ������� "export".

     ������.
     ����� ������ (��������� ����) "p", ������� ���:

     # ������ p
     echo ������ p
     varX=0 varY=1
     echo varX=$varX varY=$varY
     export varY
     p1  # ����� ������� p1
     p2  # ����� ������� p2
     echo ����� ������ p: varX=$varX varY=$varY

     �������� ��������� ����� "p1" � "p2", ������� ���:

     # ������ p1
     echo ������ p1
     echo varX=$varX varY=$varY
     varX=a varY=b
     echo varX=$varX varY=$varY
     export varX

     # ������ p2
     echo ������ p2
     echo varX=$varX varY=$varY
     varX=A varY=B
     echo varX=$varX varY=$varY
     export varY

     �� ����� ����� ������ ��������� ����������:

     ������ p
     varX=0 varY=1
     ������ p1
     varX= varY=1
     varX=a varY=b
     ������ p2
     varX= varY=1
     varX=A varY=B
     ����� ������ p: varX=0 varY=1

     ��  �������  �����,  ���  �������� ���������� ��������������
������  �  ���������� ������� (� �� ���������� "�����" � "����").
�������������� ���������� ����� � �������� "set" � ������ "-a".
     ��   ������   ������   �������,  ���  ��  ��������  ��������
����������    ��������    �������   ��   ���������   "����������"
�������� ������������ (������) �������� � �������� �������.


		4.5. ���������

     �  ���������  ����  �����  ����  �������� ���������. � shell
������������  ����������� ��������� (�.�. ����������� �����������
��  ����������).  �  ���������  �����  ��������������� ����������
����������  (����������  shell-����������)  ����������  � �������
"$", � ����� ������� ���� �� ���� �� 0 �� 9:

     �����  ������  "examp-1"  ����������  � ����������� "cock" �
"tail".  ���  ���������  ��������  � ����� ����� ��� ������������
�������  "1" � "2". � (�����������) ���������� � ������ "0" �����
��������� ��� ���������� �������.
     ���  ���������  �  ����������  �����  ������ �������� ������
������� "$" (��� � ��� ��������� � ����������):
     $0 - ������������� ����� ������� ���������� �����;
     $1 - ������ �� ������� ��������;
     $2 - ������ �������� � �.�.

     ����� ��������� ���� � ������ "examp-1" ����� ���

      echo ��� ������ $0:
      sort $2 >> $1
      cat $1

     � ����� "cock" � "tail" �������� �������������

cock:
      ��� ��������������� ����:

tail:
      1
      3
      2

     ����� ����� ������ �������

      examp-1 cock tail

�� ������ �����

     ��� ������ examp-1:
     ��� ��������������� ����:
     1
     2
     3

     ���������  �����  ����������,  �  ������� ����� ������������
���������,  ����������  �����  ������,  �.�.  9-�  ("0",  ��� ���
����������  �����  ������  �����), �� ��� �������� �������� �����
���������� ������������ ����������� ������� "shift".
     ���������� �� �������� �� �������.

     ����� ��������� ���� "many" ���������� � 13-� �����������

     many 10 20 30 40 50 60 70 80 90 100 110 120 130

     � ����� ���


     ###
     # many: �������� �������� ����� ����������.
     echo "$0: ����� ����������"
     echo " ����� ����� ���������� = $#
     �������� ���������: $1 $5 $9 "
     shift
     echo "1 �����: ������=$1 �����=$5 �������=$9"
     shift 2
     echo "1 + 2 = 3 ������: ������=$1 �����=$5 �������=$9"
     perem=`expr $1 + $2 + $3`
     echo $perem

     �  ����������  �������  ����������  �������  "shift"  ������
��������  �������  ����������  ��� $1, ������ �������� ����������
���  $2,  ...  �������  ��������, ������� ��� ������� ����������,
���������� ��� $9. �� ���� ����������� ������ ��������!
     ����� ���������� ����� ������� �� ������ �����:

     many: ����� ����������
     ����� ����� ���������� = 13
     �������� ���������: 10 50 90
     1 �����: ������=20 �����=60 �������=100
     1 + 2 = 3 �����: ������=40 �����=80 �������=120
     150

     ������������ ������ � ���������� ���� ������� "set".
     ��������, �������� �������

     set a b �
     echo ������=$1 ������=$2 ������=$3

     ������ �� �����

     ������=a ������=b ������=c

     �.�.  �������  "set"  ������������� �������� ����������. ���
������  �����  ������.  ��������,  ������� "date" ������ �� �����
�������  ����,  ������, "Mon May 01 12:15:10 2000",  ��������� ��
���� ����, �����

      set `date`
      echo $1 $3 $5

      ������ �� �����

      Mon 01 2000

     �������   "set"   ���������   �����   ������������  ��������
���������� ���������, ��������:
     set -v - �� �������� ��������� ������, �������� shell.
     set +v - �������� ���������� �����.
     set -x - �� �������� ��������� ������� ����� �����������.
     set +x - �������� ���������� �����.
     �������  "set"  ��� ���������� ������� �� �������� ���������
����������� ����� (�� �����).

	       4.6. ����������� shell-��������������

     �����  �������  ���������������� ������������� � �����������
������,   ������������   �   ���������  ������,  shell  ���������
��������� ���� �����������:
     1.   �����������   �����������.   �����������  ���  �������,
�����������  �  ��������  �������,  �  ��  �� ����� �������������
���������.
     2.  �����������  ��������  ����������  � ����������. �� ����
�����, ������������ �� "$", ���������� ��������������� ����������
���������� � ����������.
     3.    �������������   ��������.   ����������������   �������
������������.
     4. ��������� ���� ������. ����������� ����� �� ������� � ���
������������   ("*", "?","[]")   �  �����������    ��������������
���������.


		  4.7. ����������� �����

     ������  ������� ����� �����, � ������� �� �����������. shell
���������� ��� ���������� ���� �����.
     ����  ��  �������� ������� "set" ��� ����������, �� �� �����
�����  ������ ���������� � ���� ����������� ����������, ���������
���  �����  �  �������  (�  ������������  �����  ���� ����� �����
���������  "��  ����������"),  �  �����  ����������,  ��������� �
�������������� ������ ����������.
     ����������  ��� � ���������� ���������� ���������� � �������
������� ������� �� ����, ����� ������ UNIX ������������ � ���
�������������� �������.
     ��� ���� ����� ����, ��� ������ ��� ������� "set":

     HOME=/home/sae
     PATH=/usr/local/bin:/usr/bin:/bin:.:/usr/bin/X11:
     IFS=

     LOGNAME=sae
     MAIL=/var/spool/mail/sae
     PWD=/home/sae/STUDY/SHELL
     PS1=${PWD}:" "
     PS2=>
     SHELL=/bin/bash
     TERM=linux
     TERMCAP=console|con80x25|dumb|linux:li#25:co#80::
     UID=501
     perem=stroka
     x=5

     ��������������� ��� ������������ �������� ����������.

     HOME=/home/sae  -  ���  ���  ��������� ����������, � �������
������������  (�  ������  ������  �)  �����������  �����  ����� �
�������.  ��  ����,  ���������  ������  ��� � ������, � ������� �
���������� "/home/sae".

     PATH=/bin:/usr/bin:.:/usr/local/bin:/usr/bin/X11    -    ���
����������  ������  �������������������  ������  (�����), �������
������������� "shell" � ������� �������. ����� ������ �����������
�����  �����������.  ������������������  ���������  �������������
�����������  ����������  ����  �  �����.  ��  ������������� �����
����������  �����  ���  ����������  ����������  ������.  �  �����
����������  ������  ������  ��������  ����� ������������ �������,
��������   "echo",  "cd",  "pwd",  "date".  �����  �����  �������
�������������   ����������  "/bin",  �  ������  �����  ����������
������� "sh", "cp", "mv", "ls" � �.�. ����� ���������� "/usr/bin"
�  ���������  "cat",  "��",  "expr",  "nroff",  "man"  �  �������
�������.  �����  �����  ���������� � ������� ���������� (".", ���
������ ����������� - "�����", �.�.""), ��� ������ ����� ���������
���������� ���� ������� (�������).
     �����  ������  ���������  ������  �  �������  "shell"
(�����   ����������   �����������  �����������)  ����������  ���,
��������������  �������  �  ������������� �� ����� � �����������,
�������������   �   �����.   ����   �������  ���������  ���  ����
�����������  -  ��� �� ����� �������. ���� ������������ ���������
������   �  ����������  ������,  ��  �������  �����  ��,  �������
����������� � ����������, ��������������� ������.
     �����, ��� � ������ ���������, ����� ����� ������, ��������,
�����������  ���  ��������  ����������.  (������,  ��������������
����� �������� �� "���������" ����� ���������� � ������������).

     IFS=   - (���������� ����������� �����) ����������� �������,
�������  ������  ���  ����������  ���� (�����). �������� ��������
"������",  "���������" � "������� ������", ������� ����� ����� ��
������������ ������ �� ����� � ������ ��� ������.

     LOGNAME=sae  - ��� ����� ("���" ������������).

     MAIL=/var/spool/mail/sae  -  ���  �����, � ������� ���������
(�����������) �����.

     PWD=/home/sae/STUDY/SHELL  - ��� �������� ����������

     PS1=${PWD}:" "   - ��� ��������. � ������ ������ � ���������
�����  ����������  ��� �������� ���������� ��������� � ������. ��
���� ����� ����� "/home/sae/STUDY/SHELL: ".

     PS2=>   -   ����   �������   (�����  ">")  ������������  ���
�����������    �   �����������   �����   (�   ���������   ������)
�������������  �������. ��������, �������� ����������� ������ "("
�  �����  �������    �  ���������  ������  �� ������� ����
��������.  ����  ����  ��  ������,  ���  ������  ������, ��������
����������� ������ ")" - � �� ��������.

     SHELL=/bin/bash - ��� ���������� ��������� ��������, �������
����������   ������������.   �   ������  ������  ������������  ��
(�����������)  shell  ("sh"),  �  "�����������"  ������ - "bash",
���������� ��� �� ������� (Bourne-Again SHell).

     TERM=linux - �������� ���� ���������.

     TERMCAP=console|con80x25|dumb|linux:li#25:co#80::          -
(TERMinal  CAPacity) ��� (����� ������) ���������� ������ �������
���������� ���������.

     UID=501       -  ������������� ������������ (��� - "501").

     perem=stroka
     x=5          - ����������, ������� ���� ������������.

     ��������  �����  ���������������  �������������  ��� ����� �
������� � �������������� ������ ���� "/etc/rc" � "/etc/.profile".
     ������  ���������.  ����  ��  ��������  ������ ������� �����
(��������,  ����� ������ ������, ��� ��������, ��� ��������, ����
������  �  �.�.) �����, ��������� ��� ���������� � ����� ��������
����������     �     �������������������     �����     ".profile"
(${HOME}/.profile), �������� ������ �������� ���������� �����. ��
����  �������  ���  ����  �  �������� � ��������, ��� ���������).
�����   ���   ������  �����  �����  �  �������  ����  ����  �����
�������������  ����������� � ������������� ����� �����. ���� ����
������   �����������  �����������  �  �����  ��������  ����������
(���������� �����).
     ����  �� ������ ��������� � ".profile", �� ��� �������� ����
��������� � ����� ���������� ��������� ���� ����. ��� ����� �����
�����   �   ������  �����  �  �������,  �  �����  ���������������
(����������  ���  ����� ������ ���������) �������� "." ��� ������
�� �������, �.�.

     . .profile

     �������  �����  �  ����,  ���  �����  ������, ������������ �
�����,  ������ ����� ������ ������. ���, ��� �� �������� �� �����
�������  �������� "ls" - ���������� �������� ��� ������� � ������
"-a". ������, � �� ������������ ������� �������� "rm *".

     ��������  �����  ����  ���������� "my" � ����� ������ �����,
������� � ".profile", ��������

     PATH=${PATH}:/home/sae/my

���

     PATH=${PATH}:${HOME}/my

     ���   �������,   ���������������  ����������  �����  �������
��������������. ��������,

     export TERM PATH REDKEYS MAIL

     �����  �����������  ����������  � ".profile" ����� ���������
�������, �������� �������
      stty -lcase
��������� �������� � ����� "������� � ��������� �����"; � �������
      cat ��������
     ������  ��  �����  ��������  , ������� �� ���� ����������� �
�����  "��������"  �  ������  �����  ������������  �����������  �
�������������� ������������.


     ���  �������������  shell ������������� ����������� ��������
��������� ���������� (����������):
     ?  - ��������, ������������ ��������� ��������;
     $  - ����� ��������;
     !  - ����� �������� ��������;
     #  - ����� ����������� ����������, ������������ � shell;
     *  - �������� ����������, ��� ���� ������;
     @  - �������� ����������, ��� ������������ ����;
     -  - �����, ������������ � shell.
     ���  ��������� � ���� ���������� (�.� ��� ������������� �� �
��������� ����� - shell-���������) ������� ������� ������� "$".
     ������. ����� �������

     specific par1 par2 par3

     �������� ���

     ###
     # specific: ����������� ��������� (����������)

     echo $0 - ��� �������
     echo $? - ��� ����������
     echo $$ - ������������� ���������� ��������
     echo $! - ������������� ���������� �������� ��������
     echo
     echo $* - �������� ����������, ��� ������
     echo $@ - �������� ����������, ��� ����
     echo
     set -au
     echo $- - ������ ������ ��������������

     ������ �� �����

     specific - ��� �������
     0 - ��� ����������
     499 - ������������� ���������� ��������
     98 - ������������� ���������� �������� ��������

     par1 par2 par3 - �������� ����������, ��� ������
     par1 par2 par3 - �������� ����������, ��� ����

     au - ������ ������ ��������������


     ���  "0" ������������ ����������� ���������� ��������.
     ������   ����   ���   ��������   ����������   ������  ������
�����������   ����������  "$$",  ��������  �������  �������������
������ ��������, ������������ ������ ������. ������ ����� ������,
����������� �����������, ���������� ���� ��� ��������� ���������,
�������������  ����������  ������  ��-�������. �������, ���������
�����  �������� � �������� ����� �����, ����� ���� ���������, ���
������  �����  ����  ����� ����� ����� ��� (�� ��������� �� �����
���  �������������).  �����������  �������� � ������� �����������
������  �������  ���������� ������. ����������, ����� ����� �����
���������  ������.  �, ���� � ������ ������� �������� ����� �����
���� "�� �����", �.�., ����������� � ����, ��������� $$, �� �����
�����  �����  �����  �����  ��������.  ��� ������� ��������������
�������� ��� ������� ��������.
     "echo" ��� ���������� ������� ������ ������.
     ��������  $*  � $@ ������� � ���, ��� ����� ���������� �����
����  ������������  ���

     "par1  par2  par3"

� ������ ���

     "par1" "par2" "par3"

     ������, �������������� �������� "$*" � "$@" ����� ����������
� ����� � ���������� "for".
     ���   �����������   ��   ����������  ��������  "set"  ������
��������������  ("a" - ��� ����������� ���������� ��������������;
"u"  -  ���������� ��������� ������� �������), ��� � ���������� �
����������� ���������� "$-".


		  5. �����������  ���������

     ��� �� ������ ����� ���������������� � ������ �� ����� shell
�����  ����  �����������. ��� ����� ������������ ������ "#". ���,
���  ���������  � ������ (� ��������� �����) ����� ����� �������,
�������������� ��������������� ��� �����������. ��������,

     # ��� �����������.
     ## � ���.
     ### � ��� ����.

     ���  ��  ������  �����������  ����� ���������������� � �����
shell   ����   ���������.   ���  ����������  ���������  ���������
�������������������  ����������  ������. � ����� ���������� �����
����������  ��������  �������,  �������  � ���������� �����������
����������� ����������.


		 5.1. ������� test ("[ ]")

     �������  test  ���������  ����������  ����������  �������. �
��������������  ����  (����������)  ������� ����������� ���������
������ � ����� ����� shell.

     ��� ��������� ������� �������:

     test �������
���
     [ ������� ]

     ��  �����  ������������  ������ ���������, �.�. ������ ����,
����� ������ ����� �������� ����� "test", ����� ��������� �������
� ������, ��� ����� �������� ��� �������������.
     ��  �����  ����  shell  �����  ������������  ���  ������� ��
�����������  ������  "[",  ���  �����(!), ��������������� �������
"test".    ���    �����    ����������,   �����   ������������   �
���������������� ������ ����������: ����� �������� � ������������
� ��� �������� ����������� ������ ���� �������.
     �������  ������ ���� � ����� ���������� � �������� ���������
���  ��������  (���,  ������,  �  �  ������� "expr"). �� ������ �
��������������� ����������� ��� ������������ �������� ����������.
     � shell ������������ ������� ��������� "�����".

     ������� �������� ������:
     -f file - ���� "file" �������� ������� ������;
     -d file - ���� "file" - �������;
     -� file - ���� "file" - ����������� ����;
     -r file - ������� ���������� �� ������ ����� "file";
     -w file - ������� ���������� �� ������ � ���� "file";
     -s file - ���� "file" �� ������.

     �������. ����� � ���������� ��������� ������ � ������ ������
�������  �������������  (���  ����������  "0"),  �  ��  ������  -
������������ (��� ���������� "1"). "specific" - ��� �������������
�����.

     [ -f specific ] ; echo $?
     0

     [ -d specific ] ; echo $?
     1

     ������� �������� �����:
     str1 = str2  - ������ "str1" � "str2" ���������;
     str1 != str2  - ������ "str1" � "str2" �� ���������;
     -n str1  - ������ "str1" ���������� (��������);
     -z str1  ������ "str1" �� ���������� (������).

     �������.

     x="who is who"; export x; [ "who is who" = "$x" ]; echo $?
     0

     x=abc ; export x ; [ abc = "$x" ] ; echo $?
     0

     x=abc ; export x ; [ -n "$x" ] ; echo $?
     0

     x="" ; export x ; [ -n "$x" ] ; echo $?
     1

     ������  ���������.  �������  "test"  ����  �������� "������"
(�.�.  ��� ���������� "0") � ������ ���� � ������� ����� ��������
�����.

      [ privet ] ; echo $?
      0

      [ ] ; echo $?
      1

     �����  ����,  ����������  ���  ����������� �������� �������,
�������  �����  �������������� ������ ������� (��� ����� �� �����
������).

      true ; echo $?
      0

      false ; echo $?
      1

     ������� ��������� ����� �����:
     x -eq y   - "x" ����� "y",
     x -ne y   - "x" ������� "y",
     x -gt y   - "x" ������ "y",
     x -ge y   - "x" ������ ��� ����� "y",
     x -lt y   - "x" ������ "y",
     x -le y   - "x" ������ ��� ����� "y".

     ��  ����  � ������ ������ ������� "test" ������������ ������
��������  ���  ����� (!) �����. ������� �� ���� ��������� �������
"��������"  ��������  �������������  ������  ������.  � ������ ��
������,  ����  ����  ��������  ����������,  ������,  "x",  �� ���
����������� ������������� "x=0".
     �������.

     x=abc ; export x ; [ abc -eq "$x" ] ; echo $?
     "[": integer expression expected before -eq

     x=321 ; export x ; [ 321 -eq "$x" ] ; echo $?
     0

     x=3.21 ; export x ; [ 3.21 -eq "$x" ] ; echo $?
     "[": integer expression expected before -eq

     x=321 ; export x ; [ 123 -lt "$x" ] ; echo $?
     0

     ������� �������:
     ����������� � ������� ������� ���������� ��������:
     !   -  (not)  ����������� �������� ���� ����������.
     -o  -  (or) ������������ ����������� "���".
     -a  -  (and) ������������ ����������� "�".
     ��������������. �� ��������� � ��������.

     �������.

      [ ! privet ] ; echo $?
      1

     x=privet; export x; [ "$x" -a -f specific ] ; echo $?
     0

     x="";export x; [ "$x" -a -f specific ] ; echo $?
     1

     x="";export x; [ "$x" -a -f specific -o privet ] ; echo $?
     0

     x="";export x; [ "$x" -a -f specific -o ! privet ] ; echo $?
     1

     �����. �� �������������� �������� ���������.


		5.2. �������� �������� "if"

    � ����� ������ �������� "if" ����� ���������

    if  �������
      then  ������
	 [elif  �������
	  then  ������]
      [else  ������]
    fi

     �����  "elif"  �����������  �������  �� "else if" ����� ����
�����������   ������   �   ������,   �.�.   �����������  ��������
�������������  �����  ����������  "if" (��� � ������ ����������).
����������  "������"  �  ������  ������ ������ ���� ����������� �
���������� � ������ ���������.
     �����������

     [elif  �������
      then  ������]
�
     [else  ������]

     ��  ��������  ������������� (� ������ ������ ��� �������� ��
����������������  ����������� ������������ ���������� ������ - ��
������ � ����������� �������� ������� "test"!).
     ����� ��������� ��������� ����� ���������

    if   �������
      then  ������
    fi

     ����  ���������  �������  (���  �������  ��� ��� ������� ���
���������� "0", �� ����������� "������", ����� �� ������������.
     ��������  ��������,  ���  ���������  ����������� �����������
���������  ������  "fi".  �����  "fi", �����������, ������ ������
�������������� ����� "if".

     �������.
     ����� ������� ������ "if-1"

     if [ $1 -gt $2 ]
	then pwd
	else echo $0 : Hello!
     fi

     ����� ����� �������

     if-1 12 11

����

     /home/sae/STUDY/SHELL

�
     if-1 12 13

����

     if-1 : Hello!

     ��������  ������������  �  �������  ��  ��������  shell, ���
�������  �����  �������� ��������� ��� ����������. ��� ����������
������ ���������������� �� ��. ����� ������ "if-2" �����

     if a=`expr "$1" : "$2"`
	then echo then a=$a code=$?
	else echo else a=$a code=$?
     fi

����� �����

     if-2  by by

����

     then a=2 code=0

�

     if-2  by be

����

     else a=0 code=1


     ��� ������ �� �����������

     ###
     # if-3: ������ ����������

     echo -n " � ����� ������ ������� �� ��������?: "
     read z
     if [ $z = 5 ]
	then echo  ������� !
	elif [ $z = 4 ]
	     then echo  ��� ����� ������� !
	     elif [ $z = 3 ]
		  then echo  ��� ����� !
		  elif [ $z = 2 ]
		       then echo  ��� !
		       else echo   !
     fi

     �����  ��������  �������� �� ��, ��� ���������� ������������
������  ���  ������  ��������,  �����  ����� �������� �����������
��������.


	       5.3. �������� ������ ("case")

     �������� ������ "case" ����� ���������:

     case   ������  in
	������)  ������ ������;;
	������)  ������ ������;;
	    ...
     esac

     �����  "case" "in" � "esac" - ��������� �����. "������" (���
�����  ����  �  ����  ������)  ������������  �  "��������". �����
�����������  "������  ������" ��������� ������. ����������� �����
���������   �����   "esac",  ��  ���  ����������  ���  ����������
���������.
     ������.

     ###
     # case-1: ��������� "case".
     #         ��� ����������������� � ����� ��
     #         ���������� "if" ������ ����� �
     #         ��������� ����� ����������� �
     #         ������� ��������� "case".

     echo -n " � ����� ������ ������� �� ��������?: "
     read z
     case $z in
	5) echo ������� !            ;;
	4) echo ��� ����� ������� !  ;;
	3) echo ��� ����� !          ;;
	2) echo ��� !                ;;
	*) echo  !                   ;;
     esac

     ����������  ��������  � ����� ����� ������ ";;", �� ��������
�����  ";"  ����  ��  �������. ��� ������ ������������ ����� ����
���������  ���������  ������.  ����  ��� ������� ����� �������� �
����  ������,  �� ������ ";" ����� �������������� ��� �����������
������.
     ������  ���������  ������  ������  �����  ������  "*", ��� �
���������   "case"   ��������   "�����   ��������".   ���  ������
����������,  ����  ��  ���������  ����������  �������� ����������
(�����  $z) �� � ����� �� ����� ���������� ��������, ������������
������� ")". �������� ��������������� � ������� ������.

     ###
     # case-2:  ����������.
     #          ��� ��������� ���� �� ����� ��������
     #          �������� ��������, � ������� ��� ������

     case $1 in
	     ONE|TWO|THREE) echo �������: ZERO    ;;
		   MMM|WWW) echo �������: Not-Net ;;
	 Hi|Hello|Howdoing) echo �������: ������! ;;
			 *) echo ��� ����� �����  ;;
     esac

     ��� ������ "case-2 Hello" �� ����� ����� ��������:

     �������: ������!

     � ��� ������ "case-2 HELLO" �� ����� ����� ��������:

     ��� ����� �����

     ����  ����� ����� "case" ����������� ��� "�����", �� ��� ���
��  �����  ��  ��,  ���  �����  ���  ���������  ������������  ���
���������� ���������� ����.

     ###
     # case-3: ���������� ���� � ������� ������� "case"

     echo "�������� ����, � ����� (����� ������)
     �������� �����, ��������������� ���������
     ���������:
	    1 - �������������
	    2 - ������ �� �����
	    3 - ���������� ����� �����  "
     read x y  # x - ��� �����, y - ��� �������
     case $y in
	1) sort   < $x               ;;
	2) cat    < $x               ;;
	3) wc -l  < $x               ;;
	*) echo "
		   �� �� �����
		   ����� ������� ! " ;;
     esac

     ����������,  �������  �����  ����  �����  ������� � �� �����
���������  ������ ����� ���� ������������������ ������ ��� ������
����� ������� ��������.
     �������  �������  "case-4",  �������  ��������� ���������� �
�����,  ����������  ������  ����������  (����  �������� ����), ��
������������  �����, ���� (���� 2 ���������) �� �����, ����������
� �������� ������� ���������:

     ###
     # case-4: ���������� � ����.
     #         ������������� ����������� ����������.
     # "$#" -  ����� ���������� ��� ����� �������
     # ">>" -  ��������������� � ����������� � ����

     case $# in
	  1) cat >> $1                           ;;
	  2) cat >> $2 < $1                      ;;
	  *) echo "������: case-4 [������] ����" ;;
     esac

     "$1"  (���  "$#=1")  -  ���  ��� �����, � ������� ����������
���������� �� ������������ �����.
     "$1"  �  "$2"  (���  $#=2)  - ��� ����� ������ , �� ��������
("$1") � � ������� ("$2") ���������.
     ��  ����  ������ ������� (*) �������� ��������� � ���, �����
������ ���� ���������� ������ �������.


	  5.4. �������� ����� � ������������� ("for")

    �������� ����� "for" ����� ���������:

    for ��� [in ������ ��������]
	do
	    ������ ������
	done

     ���  "for"  - ��������� ����� ������������ ��� �����, "do" �
"done" - ��������� �����, ���������� ���� �����. �� ��������� ���
"done"! �������� "in ������ ��������" ����� �������������.

     ����� ������� "lsort" ������������ ��������� ������

     for i in f1 f2 f3
     do
       proc-sort $i
     done

     �  ���� ������� ��� "i" ������ ���� ��������� �����. ��� ���
����� ������������� ��� shell-����������, ������� ���������������
�������������   �������������  ��������  (i=f1,  i=f2,  i=f3),  �
����������� � ����� ������� "procsort".
     �����  ������������ ����� "for i in *", ���������� "��� ����
������ �������� ��������".
     �����  "proc-sort"  � ����  ������� �������������� ���������
������

   cat $1 | sort | tee /dev/lp > ${1}_sorted

     �.�. ��������������� ����������� ��������� �����, ����������
���������� ��������� �� ������ ("/dev/lp") � ������������ � �����

   f1_sorted  f2_sorted  �  f3_sorted

     �����  �������  ����� ������������� ������� "lsort", ���� ��
�����������  �������� ������ � �������, � ���������� ������������
�� ����� �����������.
     ����� �������� ��������� ����� ���������:

   for i
       do
	 proc-sort $i
       done

     �����   ����������   �����   "i"  ����������  �����  "in"  �
�������������  ����  �������  �  ��� , ��� ������ ��������� �����
���������  �������. ��������� ����������� ������� ����� ��������,
������

   lsort f1 f2 f3

     ��������   �����   �����������������   ������   (���  ������
"case-2")  �����������  ��������  �����.  ������ ����� ��� ������
���������   ������������   ����������   ����.  ���  ����������  �
���������   ���������   "for"  ���������  "in  ������  ��������",
�������� ������� �� ���������� ���������� �������.

     ###
     # holding: ����������.
     #          ��� ��������� ���� �� ����� ��������
     #          �������� ��������, � ������� ��� ������
     for i
	 do
	     case $i in
			 ONE|TWO|THREE) echo �������: ZERO    ;;
			       MMM|WWW) echo �������: Not-Net ;;
		     Hi|Hello|Howdoing) echo �������: ������! ;;
				     *) echo ��� ����� �����  ;;
	     esac
	 done


     ��� ������ "holding Hello HELLO ONE" �� ������ �����:

     �������: ������!
     ��� ����� �����
     �������: Not-Net

     ��� ������.

     ###
     # subdir: ������ ����� ���� ��������������
     #         ���������� � ������ $dir

	     for i in $dir/*
	     do
		if [ -d  $i ]
		   then echo $i
		fi
	     done

     ���������  ������  ������������  ��������,  ����  �  � �����
�����������,  ������ ���������� ����� � ��� �� �������� ���������
���. ���������� "i" ��������� ����� ���� ��������: 1, 2, 3, 4, 5,
��  ������ ����� ��� ���������� ����������� � ������� �� ��������
�������  ����  ��  ������ � �� ���� �� ������. � ����� �� �������
����������  "i"  ����� ��������� ��������, ������ � � � � � , � �
����������  �����  �����  ���� �� ���� ��� ��������� ���� � �� ��
���������� ����������� ����� ��� ���������.

     ###
     # print-5: ����������� ������������ ���������� �������

     for i in 1 2 3 4 5
	do
	   cat file-22 > /dev/lp
	done

     ������  "print-n" ������������ ��� ���� �������� �����������
�   �������������   �����   "for".  �����,  �����  "for  i  ...",
�����������  "in ..." � �������� ����, �.�. �������� ���� ��� "i"
����������   ��������   ����������,  �  �������������  ����������
���������� ����������� ����� ������.

     ###
     # print-n: ������� ����� �����
     #          ����� ���������

     for i
	  do
		  cat file-22 > /dev/lp
	  done

     ����� �� ���������, ���� ������ ������ ������� �������� ���

	for i in $*

     ��������� �������� "$*" - ���� ������ �������� ����������.

     �������  ��������  �  �����������  ����������  "$*"  � "$@",
��������������    ��������    ����������.   ������   ������������
���������, ��� ������, � ������, ��� ������������ ����.
     ����� ��������� ���� "cmp" ����� ���:

     for i in "$*"
       do
	   echo $i
       done
     echo
     for i in "$@"
	do
	   echo $i
	done

��� ������

     cmp aa bb cc

�� ����� ����� ��������

     aa bb cc

     aa
     bb
     cc


	5.4. �������� ����� � �������� �������� ("while")

     ��������� "while", ����� �������������� ���������� ��������,
����������������  �����,  �����  ���������� ������� ������ ������
��������  ����������  ���  ����  ������  ������  ����  �������  �
���������� ���������� � �����.

    �������� ����� "while" ����� ���������:

    while �������
	do
	    ������ ������
	done

     ���  "while"  -  ���������  �����  ������������  ��� ����� �
��������  ��������.  ������  ������  �  ����  ����� (����� "do" �
"done")  �����������  ��  ���  ���,  ����  ����������� ����������
������� (�.�. ��� ���������� ��������� ������� � ���� ����� �����
"0")  ���  ����  ��  ����� ������� ������� ������������ ���������
("break", "continue" ��� "exit"). ��� ������ ����� � ���� �������
������ �����������.

     ###
     # print-50: ��������� "while"
     #           ������ ��������� ���������� 50
     #           ����������� ����� "file-22"
     n=0
     while [ $n -lt 50 ]    # ���� n < 50
     do
	n=`expr $n + 1`
	cat file-22 > /dev/lp
     done

     �������   ��������   ��   ��,  ���  ����������  "n"  �������
�������������  ��������  0,  �  �� ������ ������, ��� ��� �������
"expr"  ��������  �  shell-����������� ��� � ������ �������, � ��
��� �� ��������.

     n=`expr $n + 1`

     �.�. ��� ������ ���������� �������� "n" ������������� �� 1.

     ���  �  ������  �  �����,  �����  �����������  �� �� ����� �
�������.  ������  "�r-br"  ��������  ��� ����������� ������������
�����  �  �������������  �������  "break",  �������  ������������
����������� �����.

     ###
     # �r-br: ��������� "while" c "break"
     #        ������ ��������� ���������� 50
     #        ����������� ����� "file-22"
     n=0
     while true
     do
	if [ $n -lt 50 ]           # ���� n < 50
	   then n=`expr $n + 1`
	   else break
	fi
	     cat file-22 > /dev/lp
     done

     �������  "break  [n]"  ��������� �������� �� �����. ���� "n"
�����������,  ��  ��� ������������ "break 1". "n" ��������� �����
���������  ������,  ��  ������� ���� �����, ��������, "break 3" -
����� �� ���� ��������� ������.
     �  �������  ��  �������  "break" ������� "continue [n]" ����
����������  ����������  ��������  �����  �  ����������  �� ������
�����.  ��� ����� ����� ���� � ����������. ��������, "continue 2"
��������  �����  ��  ������  �������  (����  �������  �� �������)
���������� �����.
     �������  "exit  [n]"  ���������  ����� ������ �� ��������� �
�����  ��������  "0"  ���  "n"  (����  ��������  "n" ������). ���
�������  ����� �������������� �� ������ � ������. ���� � ��������
������������������  ������  ���  �����  ���� ������� ��� �������,
����� ��������� ���������� (��������) ������� � �������� �����.


	   5.5. �������� ����� � ������ �������� ("until")

    �������� ����� "until" ����� ���������:

    until �������
	do
	    ������ ������
	done

     ���  "until"  -  ���������  �����  ������������  ��� ����� �
������ ��������. ������ ������ � ���� ����� (����� "do" � "done")
�����������  ��  ���  ���,  ���� ����������� �������� ������� ���
����  ��  �����  ������� ������� ������������ ��������� ("break",
"continue" ��� "exit"). ��� ������ ����� � ���� ������� �� ������
�����������.
     �������  ��  ���������  "while"  �������  � ���, ��� �������
�����  �����������  ��  ��������  (��  ���������  ���  ����������
���������  �������  ����  �����) ����������� ����� ������� (� ���
����� � �������!) ���������� ������ ���� �����.
     �������������,  ��������  �  �����������  "until"  �  ������
������ ����� ������� ������� ����� ��������� ����� ���������.
     �������.

     until false
     do
	 read x
	 if   [ $x = 5 ]
	   then echo enough ; break
	   else echo some more
	 fi
     done

     �����   ���������  �  �����������  ������  ����  �����  ����
(��������  ��  ������  �����  "some more"), ���� �� ����� �������
"5".  �����  ����� �������� "enough" � ������� "break" ����������
���������� �����.
     ������  ������  ("�������� ������") ������������ �����������
������������ � ������� ����������.

     until date | grep 12:00:
     do
	 sleep 30
     done

     ����� ������ 30 ������ ����������� ��������� ������ �������.
�������  "date"  ������  �������  ����  �  �����.  ������� "grep"
��������  ���  ����������  �����  ��������  � �������� ����������
��������  ������ "12:00:" � ��������, ���������� �������� "date".
��� ������������ "grep" ������ ��� �������� "1", ��� ������������
�������� "����", � ���� "��������� ��������" � ������� 30 ������,
�����  ���� ����������� ���������� �������. � ������� (�������� �
�����������   ���������)  ����������  ���������,  �������  ������
��������,  "grep"  ������ �� ����� �������������� ������ � ������
����� ����������.


		  5.6. ������ ��������

     ������ �������� ����� ������

     :

     ������ �� ������. ���������� �������� "0".
��������, � ����������� "while :" ��� ������� � ������ ����������
�����,   �����   �������������,  ���  ����  ��  �����  ������  ��
����������� ���� ��� "csh".


		  5.7. ������� � shell

     �������   ���������  �����������  ������  ������  shell  ���
������������ ����������.

     �������� ������� ���� ���:

     ���()
     {
     ������ ������
     }

     �����  ����  ���������  �  �������  ���������� �� �����. ���
����������  ������� �� ��������� ������ ��������. ��� �����������
� ����� ��������������� ��������. ��������� ������� ���������� ��
������������  �����������;  ���  �������  -  �� ������� ��������.
��������  ����������  �������  ����� ���������� "return [n]", ���
(��������������) "n" - ��� ��������.
     ������.   �����   ��  ����������  �����  "fun"

     echo $$

     fn()                 # �������� �������
     {
     echo xx=$xx
     echo $#
     echo $0: $$ $1 $2
     xx=yy ; echo xx=$xx
     return 5
     }

     xx=xx ; echo xx=$xx
     fn a b               # ����� ������� "fn" � �����������
     echo $?
     echo xx=$xx

����������� �������� � ����� ������� "fn", ������ �� �����:

     749
     xx=xx
     xx=xx
     2
     fun: 749 a b
     xx=yy
     5
     xx=yy


		5.8. ��������� ���������� ("trap")

     ������   ����������   ��������   ����������   ���������   ��
����������.
     ��������   �����   ����������   �����������   ��  ����������
������������, ��������������� ��������:
     0  - ����� �� ��������������,
     1  - ����� (���������� ���������� ��������),
     2  - ���������� �� ,
     9  - ����������� (�� ���������������),
     15 - ��������� ����������.

     ���  ������ �� ���������� ���������� ������� "trap", �������
������:

     trap '������ ������' �������

     ���� � ������� ��������� ����������, ��� ������� �����������
�����  ������  �  "�������",  ��  ����� �������� "������ ������",
�����  ����  (����  �  ������  ������  ��  ���� ��������� �������
"exit")  ����������  ��������  �  �����  ���������� � �����������
���������� ���������� �����.

     ��������,  ���� ����� ������������ �� ����������� ����������
������  �� ���������� ����� ���������� ������� ����� � "/tmp", ��
��� ����� ���� ��������� �������� "trap":

    tarp 'rm /tmp/* ; exit 1' 1 2 15

     �������  ������������  ������  ��������  �����. �����, �����
��������  ������  �����  �����������  �����  "exit" �� ����������
�����.
     �������  "trap"  ��������� � ������ ������������ ����������,
����  "������  ������"  ������.  ��� ��������, ���� ������� "cmd"
�����������  �����  �����,  �  ������������  ����� ����������� ��
�������,   ��  ���  �����������  ����������  ����  �������  �����
��������, �������� ������� � ������� ������:

     ( trap '' 1; cmd )&


			    * * *

     ���������������� �� shell ����� ������� ���������� �����, ��
������  ��  ������������  :-) ������� ���������� � ����������� ��
������  ����������, �� � ����������. ��� �����, ��� �������� ����
�����������   ������   (�   ����  �����  �������  ��'����)  �����
�����������.
     ������  ����������  ��������  ��������� �� (������ ���������
�������) ���� �� ������� �����.
     ���  ����������  ����������  ��  ����������������  ��  shell
������ ����� ������������ ����� [ 9, 1, 10, 11 ].


		       6. ����������

1.   �������� �. �������� � ������������ ������� UNIX. -
  �.: ������� � ����������, 1985. -318 �.
2.   ����� �. ����������� �� ������������ ������� UNIX.
  -�.: ������� � ����������, 1985. -232 �.
3.   ����� �. �������� � ������������ ������� UNIX.
  -�.: ���, 1987. -287 �.
4.   ����� �., ����� ��.������������ ������� UNIX. �����������
  ��� �������������. -�.: ����� � �����, 1986. -352 �.
5.   ������� �., ������ �. �������� � ������������ ������� UNIX.
  -�.: ����� � �����, 1986. -341 �.
6.   ��������� �.�., ������� �.�. ������������ ������� UNIX:
  ���������������� �������� ����������������. -�.: ������� �
  ����������, 1988. -206 �.
7.   ����� �. ������������ ������� UNIX. -�.: ���, 1986. -462 �.
8.   ������� �.�. � ��. ���������������� ��������� ������������
  ������� �����. -�.: ������� � ����������, 1985 -231 �.
9.   ������ �., ����� �.�. ����� � �������. -�.: ���, 1988.
  -392 �.
10.  ������� �.�., ������� �.�., ������� �.�. ��������� �������-
  ����� �������. -�.: ����� � �����, 1991 -208 �.
11.  �������� �.�., ���� �. UNIX - �������������  ����� �������-
  ���������. -�.: ������� � ����������, 1992 -304 �.

Понравилась статья? Поделить с друзьями:
  • Yamata fy 5550 инструкция по применению на русском
  • Ипозан для собак инструкция по применению цена
  • Уфмс по ставропольскому краю руководство
  • Ипидакрин инструкция по применению уколы цена внутримышечно взрослым
  • Как уволить сотрудника в 1с зуп пошаговая инструкция