xargs(1)の仕様

投稿者: | 2006年8月29日

 xargs(1)に空の入力を与えたとき、BSD系だと何も実行されないが、Linux(というかGNU)やSolarisなど、BSD系以外だと引数なしでコマンドが実行される。(ただし、GNU xargs--no-run-if-empty/-rで抑制できる)

 SUSv3においても:

The utility named by utility shall be executed one or more times until the end-of-file is reached or the logical end-of file string is found. The results are unspecified if the utility named by utility attempts to read from its standard input.

(下線は筆者)と規定されている。ここでの”shall”は”must”と同義だ。この仕様は実用において煩わしく、論理において美しからぬものだと思うのだが、どうだろう。引数を任意個受け取るコマンドに0個の引数を渡して有意な結果が得られる場合というのがあまり想像できない。たいがいは、以下のいずれかの挙動を示し、つまらない結果になるだろう。

  • 引数が足りずエラーになる
  • デフォルトのものを対象とする(標準入力から読む、カレントディレクトリを対象とする、など)

 よくあるgrep(1)の場合は、xargs grep baa /dev/nullのような定石があって、イテレーションの最後が1引数のみの時の対策が入力が空のときの対策を兼ねてくれる。意味が二重になっているというのは一石二鳥と言える反面、美しくないとも言える。

 引数が複数のときだけファイル名を出力する仕様をフラグで制御できればいいが、残念ながらそうしたものはSUSv3には規定されていない。

 grepはまだましな方で、「find . -type f -name '*.sh' | xargs -I @ cp -p @ /some/where/」のような場合が厄介だ。cp(1)がコピーに失敗したときの処理に加え、引数がないときの文法エラーまで面倒を見なければならない。

 SUSv3を引き合いに出したので省いたが、find(1)-print0xargs(1)-0は必ずセットで付けています。

 こうして見ると、シンプルなツールといえども、というかシンプルなツールほど、妥当な仕様を決めることは難しいということが言えそうだ。色々なものと組み合わせて使われるため、最初にすべてを見通すことはできない。多くの場合に便利そうだと思って実装した親切も、後で思わぬ落とし穴になったりする。いずれ突き詰めて再考察してみたい。

カテゴリー: Tech

xargs(1)の仕様」への3件のフィードバック

  1. binance

    I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.

    返信
  2. classification of steriods

    Indicators of muscle fatigue embody cramps, localized ache,
    muscle twitching, trembling, and a weak grip. Your chest, lats, and rotator
    cuff are a variety of the other muscles that cross your shoulder joint.

    Not giving your shoulders sufficient time to relaxation means they won’t
    have the possibility to develop. You could find yourself burning muscle instead of fat by coaching too onerous, too typically.
    The final addition to our list of the most effective compound workouts
    for larger shoulders is the landmine shoulder
    press, which requires a landmine attachment. This exercise can help you improve the energy, dimension, and definition of your shoulders while
    keeping your lower again protected.
    The upright row is a flexible shoulder exercise that targets the delts and trapezius.
    This simple motion could be very effective at stimulating hypertrophy, improving pulling
    mechanics, and constructing power for rows, deadlifts, and
    pull-ups. The shoulder muscle tissue are strengthened by upright urgent movement.
    Particularly, the entrance a half of the shoulder (anterior deltoid), however additionally, you will use some lateral delt
    and traps. The standing cable rear delt row with
    rope is a really efficient and useful exercise for constructing muscle and energy within the posterior deltoids.
    The dumbbell entrance increase to lateral increase is an train that combines two exercises that build and
    strengthen the middle deltoids and the anterior deltoids
    of the shoulders. The seated neutral-grip overhead dumbbell press is a incredible train for building energy and definition in your shoulders, significantly your anterior deltoids and lateral deltoids.

    It may also be brought on by a situation known as brachial neuritis, which is inflammation of certain nerves.
    The shoulder girdle components rely on one another to make
    sure the soundness of the shoulder, and provides
    power and ROM to the arm. If any part of the girdle is disrupted or injured, any number of signs can arise – inflicting popping within the
    shoulder. For this very cause, our shoulders are vulnerable to strain, stress, and injury.
    Whether Or Not vacuuming or playing sports, our shoulders are concerned in almost each motion. Furthermore,
    heed any sensations of discomfort or ache and scale back intensity accordingly.

    By paying consideration to your body’s indicators and
    following a structured strategy, you probably can safely return to powerlifting and achieve vital enchancment
    in your lifting performance. During rehabilitation, it’s crucial to give consideration to safe higher body workouts that minimize stress on the shoulder.
    Many of those workout routines contain lighter weights and higher repetitions, which may help enhance restoration with out overloading the shoulder.
    The recovery course of after shoulder alternative surgical procedure is a journey that
    spans several months. Initially, sufferers can anticipate 1 to 4 days
    of pain and swelling post-surgery. Light therapy workout routines begin inside
    the first two weeks, helping to promote mobility and stop stiffness.
    Total shoulder substitute surgery involves replacing the damaged components of the
    shoulder joint with artificial components.

    Attempt the Zero Momentum Side Lateral Elevate technique under and you’ll see just
    how difficult lifting lighter weights may be.
    This is among the most effective lateral delt exercises for growing shoulder measurement.

    What all this means is that it’s probably not possible to isolate
    the delts with these larger lifts. The fastest way to build bigger deltoids is
    to laser target them by using lighter weights.

    Your shoulder is certainly one of the extra delicate areas
    of your arm and is extra susceptible to accidents.
    10 to 12 pounds is an effective place to begin when you haven’t already been coaching your shoulders.

    Seated dumbbell presses isolate and interact the anterior
    (front), lateral (side), and posterior (rear) deltoids.

    This can be an anatomic complete shoulder arthroplasty or a reverse total shoulder arthroplasty, relying on the
    particular needs of the patient. Experienced shoulder surgeons carry out these procedures, making certain the absolute best outcomes for their patients.
    Shoulder replacement surgery, also referred to as whole shoulder
    substitute surgical procedure, is carried out to halt the progression of shoulder osteoarthritis and other degenerative circumstances.
    The process goals to restore motion and relieve ache, considerably enhancing the patient’s quality
    of life. If you’re using dumbbells, slightly lighter units of 8–15 reps are inclined to work
    higher. That means you aren’t losing an extreme quantity of effort
    swinging the weights into place and balancing them as you
    press them upwards.
    Shoulder alternative surgery can considerably improve the quality of life
    for these who endure from debilitating shoulder pain and limited mobility.
    Recovery milestones embody complete tissue healing, achieving a full vary
    of motion, and regaining full energy in shoulder muscular tissues.
    These milestones are critical earlier than beginning weightlifting after shoulder surgery.
    Sufferers should await substantial medical enhancements, which
    might take 6 to 12 months, depending on particular person circumstances.
    One of the crucial elements of recovery is the rotator cuff,
    a group of muscle tissue and tendons that stabilize the shoulder joint.

    The shoulders of athletes who participates in overhead sports activities like
    baseball, tennis or soccer (QB) can expertise critical wear and tear.
    In the instance above, I’ve positioned muscle teams that overlap,
    like again & biceps and chest & shoulders, spread out with no less than one relaxation day in between for adequate
    recovery. To carry out the pushdown, place your self
    in entrance of a cable machine. Keep your arms
    near your sides, and focus the motion at the elbow joint.

    When extending your arms, emphasize the contraction in your triceps.
    This is your shoulder and arm workout, with detailed step-by-step directions and videos displaying the
    method to perform every exercise. If your work sets call
    for 15lb dumbbells, one or two warm-up sets with
    lighter ones is sufficient.
    Dumbbell Shoulder Press workout routines are a superb variation of barbell shoulder Press.
    It could be carried out in a kneeling position, which will increase core
    involvement and might enhance core stability and energy of the
    stomach muscles. The barbell entrance increase is a shoulder train used to target the entrance deltoids.

    It additionally indirectly targets the other muscles of the shoulder,
    your triceps, and your core. In a sequence of
    dumbbell workouts, I’ve shared detailed exercises for
    constructing strong, defined, and rounded shoulders on this article.

    Get prepared for a combination of compound workout routines with heavy weights and isolation workout routines using comparatively gentle weights
    the place you chase the pump. For athletic purposes, the significance of robust shoulders
    can’t be overstated. Whenever you need upper-body
    efficiency, likelihood is you rely on your shoulder
    power to back you up.
    While not important, it’s a nice way to extend your body temperature
    and enhance your heart price. You’re not going for aerobic health here, just warming up, so maintain your exercise intensity low to reasonable.
    The following is a listing of 5 of one of the best shoulder exercises for males.

    Individuals working in occupations that require
    plenty of lifting can also be extra likely to
    expertise shoulder impingement. Diagnosing shoulder impingement early on is essential, as therapy might help
    prevent symptoms from getting worse. People with shoulder impingement often expertise
    basic stiffness and throbbing in the shoulder. This sort of ache could resemble that
    of a toothache, somewhat than the tearing pain of an injured
    muscle.
    Plus, it’s usually worse at night, and you may not be succesful of carry
    your arms above your head or carry issues away out of your body.
    The ache you’d feel would be like a toothache, according to the Cleveland Clinic.
    That means it would be a radiating discomfort, often from your outer arm to a little
    below the highest of your shoulder. It’s normally made worse should you raise your arms above your head or reach behind your physique, like when you were
    passing a belt by way of your belt loops. Verify out our articles on the best cable
    shoulder workouts or these barbell shoulder workouts. Even though the traps aren’t your shoulders, they work along
    with your delts to improve your efficiency and aesthetics.

    It’s a robust move that makes use of explosiveness to propel the load upward, which should enable approximately 30% more weight than a normal shoulder press.

    To mobilize the joint earlier than taking over larger lifts, add shoulder external rotations to the start of your shoulder exercise.

    Setting the cable above head top will goal extra of the rear delts and rhomboids,
    whereas lowering the cable to go peak or just beneath will place extra
    emphasis on the rear delts and traps. Isolating these posterior shoulder muscular tissues means
    much less weight is needed to build power and measurement within the goal muscular tissues.
    If you wish to build your shoulders and work on your urgent
    energy however lack the mobility to press overhead, the landmine
    press is for you. So to make sure we’re growing well-rounded shoulders,
    we’ll information you through a wide selection of shoulder workout routines, hitting different muscular
    tissues from completely different angles. With this various assortment
    of shoulder workouts extending past the essential routines,
    your shoulders will experience unparalleled energy, size, and
    definition growth.
    Most problems in the shoulder contain the muscles, ligaments, and tendons, somewhat than the bones.
    Sometimes, a person will endure a fracture, or break, of
    the humerus (arm bone) or glenoid (shoulder socket) that includes the bones
    of the shoulder. No matter how a lot weight you’re lifting, you’re going
    to want sturdy, stable shoulders to assist support the load.
    You can break up your units as the reps start creeping up – for
    example, in your set of 11 you would possibly carry out 7 reps, drop your weights, take
    a breath after which go once more for an additional 4.
    Keep in mind all reps must be performed inside 60
    seconds, and your next spherical starts once more on the finish of
    the minute. Here are four workout routines that cowl those bases and may be carried out as
    a stand-alone routine two to 3 occasions per week or integrated
    into your common exercises.
    The underhand grip retains the arms moving forward and
    backward, specifically focusing on the entrance of
    the shoulder, which might be exhausting to do with an overhand grip.
    The dumbbell lateral increase is an isolation train used to coach the medial
    deltoid. This train includes shoulder abduction,
    taking the arms with a partial bend, and raising them to the facet.

    First, prioritize workouts that use the rotator cuff muscles round your shoulder joint.
    No-equipment shoulder exercises provide a handy and accessible method to effectively engage and strengthen your shoulder
    muscular tissues. To add them safely to your
    routine, begin with practicing proper kind
    and progressively progressing while listening to your body.

    Dislocation can happen when repetitive movements stretch out the shoulder ligaments to the point where they’ll now
    not help the shoulder joint. Keep In Mind
    that a mix of those methods is essential to stopping shoulder ache from weightlifting effectively.
    So it’s important to tailor these approaches to your individual needs and limitations.

    If certain workouts consistently trigger shoulder ache,
    consider modifying or replacing them with alternatives
    that are extra comfy for your shoulders. It’s
    essential to prioritize pain-free actions while
    still difficult your muscles. Some people might have slight structural variations of their shoulder joints that
    make them more prone to pain during certain movements.
    Understanding your body’s limitations and adapting your exercises accordingly is crucial for preventing discomfort.

    You can perform it with different leg positions (seated,
     kneeling, standing) and grip variations (neutral, pronated) to add problem and target completely different muscle groups.
    This adjustments the angle of the movement and puts extra emphasis on the entrance deltoids and upper chest.

    The extra upright your torso is, the extra emphasis you will place
    in your lateral deltoids as a substitute of on your posterior deltoids.

    This is why I prefer to perform this movement with a cable machine, and ideally, a rope attachment,
    because it permits more motion and may mitigate any impingement issues.
    Plus, you have already done a standing overhead press with the push press,
    so it is good to throw some place variety into the combination. The
    overhead press is notoriously tricky because of the biomechanics, and due to this, many lifters simply are inclined to keep away
    from it.
    You can even perform the upright row using two dumbbells, which allows you to use one arm at a
    time and even out any muscular imbalances. This machine is specifically designed to target the
    shoulder muscle tissue, as it provides a controlled surroundings for overhead pressing movements.
    The shoulder machine press is superb for constructing the front and side deltoid muscles.

    Isolation workout routines are required to reinforce shoulder
    improvement and provide additional muscle-building stimulus.
    Too usually, rear and lateral delt workouts steal all the glory, leaving the entrance raise uncared for and unloved.
    I’m bringing the entrance delts back; the rear and lateral delts don’t know the method to act.
    I would suggest one day being shoulder focused after which
    the second workout, maybe recruiting different muscle groups.
    This second workout may include over-pressing movements that the shoulders are essential for.
    The pronated dumbbell rear deltoid row is a compound motion that stimulates
    the posterior deltoids by way of shoulder extension and
    horizontal abduction.
    All The Time seek the assistance of with a certified healthcare professional prior to starting any diet or exercise program or taking any dietary complement.
    The content on our web site is for informational and educational purposes solely and isn’t
    meant as medical recommendation or to switch a relationship with a qualified
    healthcare professional. This is based mostly mostly on studies with
    beforehand untrained individuals, and it is likely that you’ll require barely larger
    coaching volumes to keep growing as you get extra skilled.
    Avoid utilizing momentum or swinging the weight up using your hips, as that may
    take away work from the supposed working muscle tissue.

    If your again strength isn’t there, you’re limited in what you probably can achieve—even on a
    daily basis things like lifting one thing heavy from the floor benefit from a strong back.
    This back and shoulder exercise routine is one of many premium exercises in the StrengthLog exercise log app, which
    you can obtain free of charge utilizing the buttons under.

    Not everyone can or ought to do the exercises we’ve listed above due to health causes or
    private limitations. That stated, the teres main and minor muscle tissue profit
    from different angles with various workout routines.

    my homepage – classification of steriods

    返信

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です