EnglishFrenchSpanish

Ad


OnWorks favicon

ainsl - Online in the Cloud

Run ainsl in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command ainsl that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


ainsl - AppendIfNoSuchLine

SYNOPSIS


ainsl [options] FILE LINE [PATTERN]

DESCRIPTION


Add LINE to the end of FILE if this file does not contain this line already. If PATTERN is
given, then the LINE is only appended if PATTERN is not found in the file.

Since ainsl is written in Perl, you can use Perl's regular expressions in PATTERN. If
PATTERN is not given, LINE is used instead for matching a line in FILE. Then LINE may also
contain the anchors '^' and '$' which are only treated specialy at the beginning or end of
the pattern and are used for matching, not when adding the line. Additionaly, the
following characters are escaped in LINE: ( ) +

The exit code returned by ainsl is 0 on success and non-zero on error. See the section
EXIT CODES.

OPTIONS


-a Autocreate file if it does not exist.

-D Create debugging output.

-h Show help, version and summary of options.

-n Print the actions, but do not execute them.

-Q Quote all metacharacters in pattern. Uses perl's \Q function.

-q Quote * and + metacharacters in pattern.

-s Convert white space in LINE or PATTERN to '\s+' regexp for matching.

-N Don't prepend '$AINSL_TARGET/' to filename, even if it is set.

-v Create verbose output.

NOTES


IF the variable AINSL_TARGET is defined, its value will become the prefix for the
filename. This is used in FAI for changing files in /target without specifying /target in
the file name.

EXAMPLES


ainsl -v /etc/fstab '/dev/fd0 /floppy auto users,noauto 0 0'

Append the entry for the floppy device to /etc/fstab, if this line isn't already inlcuded.

ainsl -s /etc/exports '/srv/www @linuxhosts(async,rw) backup(async,ro)'

Add exports entry without exactly matching spaces.

EXIT CODES


0 Success: Either FILE contains the LINE/PATTERN or LINE was appended to FILE.

13 Permissions do not allow writing to FILE and LINE/PATTERN was not found in file.

28 FILE cannot be written because the filesystem has no space and LINE/PATTERN was not
found in file.

30 FILE cannot be written because the filesystem is read-only and LINE/PATTERN was not
found in file.

NOTES


This is a similar function to AppendIfNoSuchLine from cfengine(8).

Use ainsl online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    AstrOrzPlayer
    AstrOrzPlayer
    AstrOrz Player is a free media player
    software, part based on WMP and VLC. The
    player is in a minimalist style, with
    more than ten theme colors, and can also
    b...
    Download AstrOrzPlayer
  • 2
    movistartv
    movistartv
    Kodi Movistar+ TV es un ADDON para XBMC/
    Kodi que permite disponer de un
    decodificador de los servicios IPTV de
    Movistar integrado en uno de los
    mediacenters ma...
    Download movistartv
  • 3
    Code::Blocks
    Code::Blocks
    Code::Blocks is a free, open-source,
    cross-platform C, C++ and Fortran IDE
    built to meet the most demanding needs
    of its users. It is designed to be very
    extens...
    Download Code::Blocks
  • 4
    Amidst
    Amidst
    Amidst or Advanced Minecraft Interface
    and Data/Structure Tracking is a tool to
    display an overview of a Minecraft
    world, without actually creating it. It
    can ...
    Download Amidst
  • 5
    MSYS2
    MSYS2
    MSYS2 is a collection of tools and
    libraries providing you with an
    easy-to-use environment for building,
    installing and running native Windows
    software. It con...
    Download MSYS2
  • 6
    libjpeg-turbo
    libjpeg-turbo
    libjpeg-turbo is a JPEG image codec
    that uses SIMD instructions (MMX, SSE2,
    NEON, AltiVec) to accelerate baseline
    JPEG compression and decompression on
    x86, x8...
    Download libjpeg-turbo
  • More »

Linux commands

  • 1
    abi-tracker
    abi-tracker
    abi-tracker - visualize ABI changes
    timeline of a C/C++ software library.
    DESCRIPTION: NAME: ABI Tracker
    (abi-tracker) Visualize ABI changes
    timeline of a C/C+...
    Run abi-tracker
  • 2
    abicheck
    abicheck
    abicheck - check application binaries
    for calls to private or evolving symbols
    in libraries and for static linking of
    some system libraries. ...
    Run abicheck
  • 3
    couriermlm
    couriermlm
    couriermlm - The Courier mailing list
    manager ...
    Run couriermlm
  • 4
    couriertcpd
    couriertcpd
    couriertcpd - the Courier mail server
    TCP server daemon ...
    Run couriertcpd
  • 5
    gbklatex
    gbklatex
    bg5latex - Use LaTeX directly on a Big5
    encodedtex file bg5pdflatex - Use
    pdfLaTeX directly on a Big5 encodedtex
    file bg5+latex - Use LaTeX directly on a
    Big5+...
    Run gbklatex
  • 6
    gbkpdflatex
    gbkpdflatex
    bg5latex - Use LaTeX directly on a Big5
    encodedtex file bg5pdflatex - Use
    pdfLaTeX directly on a Big5 encodedtex
    file bg5+latex - Use LaTeX directly on a
    Big5+...
    Run gbkpdflatex
  • More »

Ad