What does || mean in .screenrc?

Command based on Rampion's command

screen /bin/sh -c '/usr/bin/man `cat "[email protected]"` > /tmp/manual | less /tmp/manual || read'

|| read does not mean or in the command. read seems to be a built-in -command about which I did not find explanation in my OS X's manuals.

What does || mean in the command?

-------------Problems Reply------------

|| is nearly 'or' operator.

In the code example above it will first run less /tmp/manual and if it returns a value that is not true it will run read. If the first command returns a true value then the read command is not performed because of short circuiting.

Thanks to Michiel: please note that the operator is not commutative such that it is not mathematical OR.

What MitMaro said. It's a parameter for the shell, or /bin/sh in this case. (Technically it's not a "parameter" (that's a different term) but it's part of the shell's "grammar.")

For details, you can read the man page on sh. What you're looking for is under the "Lists" section.

Snippet:

An OR list has the form

command1 || command2

command2 is executed if and only if command1 returns a non-zero exit status.

The return status of AND and OR lists is the exit status of the last command executed in the list.

Category:screen Views:0 Time:2009-07-12
Tags: screen

Related post

  • Unable to understand two lines in .screenrc 2009-05-01

    I do not know how you can see the effects of following lines in your screen bind ^g screen -t 'Google' links www.google.com bind G screen -t 'Google' sudo -u insec links www.google.com I tried unsuccessfully to press Ctrl-g at a word in a scrollback

  • Unable to source in .screenrc 2009-05-08

    I have the following in my .screenrc source ~/bin/Screen/multiUserSettings It gives me No such file or directory although I have it. The following code says me that unknown command ".". . ~/bin/Screen/multiUserSettings It is strange, since I can sour

  • Unable set colors according to Terminal's support in .screenrc 2009-05-29

    I would like to have a if-else loop in .screenrc for the following codes such that it is run if my terminal supports 256 colors. Otherwise, it is not run. attrcolor b ".I" # tell screen how to set colors. AB = background, AF=foreground termcapinfo xt

  • Custom script in .screenrc 2010-03-03

    I made a script that spawns a remote shell or runs a local shell whether it's on the current machine or not: #!/bin/bash # By: benoror <[email protected]> # # spawns a remote shell or runs a local shell whether it's on the current machine or no

  • chdir in .screenrc in mac doesn't work? 2011-04-11

    I could chdir in .screenrc in linux so that when I open up screen, I could go to specified directory(for each tab) Haven't had success with chdir in mac with screenrc Anyone have done this? Thank you --------------Solutions------------- Works for me.

  • Can't get the correct format for my .screenrc 2011-05-10

    This is my .screenrc. The goal, was for it to load up the client in the furthest left panel with a width of 85 (in gnome-terminal, FYI), the next section would be split in two, top and bottom. Both running a tail on two different files. And furthest

  • .screenrc bindkey for Cmd-Right on MAC 2011-09-06

    I'm trying to bind Cmd-Right and Cmd-Left to next and previous in my screenrc. I've seen entries like the following but I do not know how to find the keycode for Cmd-Right or Cmd-Left. Is there a utility I can use somewhere? bindkey "^[[1;5C" next #

  • Run commands in GNU Screen windows from .screenrc 2011-09-28

    Is there a way to send a sequence of commands to GNU Screen windows from my .screenrc? It seems like this should be easy to do: .screenrc: startup_message off screen -t "RAILS SERVER" <send command to last created window> <my alias to cd Rai

  • How do you specify a tab in .screenrc? 2009-02-07

    According to this website, you can change to command key sequence used by the Unix "screen" utility like this: escape ^Bb # Instead of Control-a, make the # escape/command character be # Control-b How would you make it Control-Tab, I wonder? --------

  • Unable to understand a code in .screenrc 2009-07-13

    I am not sure about the exact purpose of the following Rampion's code. It should apparently execute command(s) at the cursor position. # man-word.screen # prevent messages from slowing this down msgminwait 0 # copy word starting at cursor copy # I am

  • What is the right syntax to enable logging in screen using a separate screenrc file? 2012-04-08

    I have set up a screen rc file like this: log on shelltitle apt logfile $HOME/configs/screen/screenlogs/apt.log logtstamp after 120 and I am starting like this: screen -c ~/configs/screen/apt.rc But after using for a while the apt.log file is never c

  • Screen + vim causes shift-enter to insert 'M' and a newline 2008-09-15

    When running a vim instance in gnu screen hitting shift enter in insert mode adds an 'M' and then a newline, rather than just a newline. Does anybody know what the problem might be, or where to look? Thanks in advance Relevant system info: Ubuntu 8.0

  • GNU Screen Survival Guide 2008-09-16

    What do people think are not only the essential things you need to know about the excellent Screen utility but the things that you'd think worthwhile to teach someone, a beginner, from the ground up. I've just introduced a friend to Screen and they'r

  • What is GNU Screen? 2008-09-16

    What is GNU Screen? --------------Solutions------------- What is GNU Screen? Great! Erm, a slightly more useful answer: it allows you to run multiple console applications, or commands, in one terminal. Kind of like a tabbed terminal emulator. In fact

  • How to clear the scrollback in the screen command? 2008-09-22

    I use the screen command for command-line multitasking in Linux and I set my scrollback buffer length to a very large value. Is there a key combination to clear the buffer for a certain tab when I don't want it sitting there anymore? --------------So

  • Is it possible to select a specific tab in OSX Terminal.app using keyboard shortcuts? 2008-10-03

    I know I can cycle through my tabs using cmd+{ or cmd+}, but is it possible to select a specific tab (i.e. cmd+3 for the third tab in iTerm) in Leopards' Terminal.app? --------------Solutions------------- This is an option. Tab Switching in Terminal

  • multi tabbed SSH client using screen 2008-12-04

    Is there an SSH client that can present a client side GUI interface to the screen* program? I'm thinking of an SSH program that would hook in with screen's session handling and map client side actions (clicking on a tab, ctrl-tab, scrolling, possibly

  • Using the scrollwheel in GNU screen 2008-12-11

    How can I setup GNU screen to allow the mouse's scrollwheel to scroll around in the scrollback buffer? I tried to Google about this, but most hits where on how to allow applications inside screen to use the scrollwheel. --------------Solutions-------

  • How do I use GNU Screen transparently 2009-02-02

    I want to use GNU screen in such a way that the user doesn't know it's there. It's to help ensure that a text based management application that I'm writing can only be used by a single user at a time. To guard against against users locking everyone e

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.097 (s). 11 q(s)