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
    OrangeFox
    OrangeFox
    Fork of TeamWinRecoveryProject(TWRP)
    with many additional functions, redesign
    and more Features:Supports Treble and
    non-Treble ROMsUp-to-date Oreo kernel,
    built...
    Download OrangeFox
  • 2
    itop - ITSM  CMDB OpenSource
    itop - ITSM CMDB OpenSource
    IT Operations Portal: a complete open
    source, ITIL, web based service
    management tool including a fully
    customizable CMDB, a helpdesk system and
    a document man...
    Download itop - ITSM CMDB OpenSource
  • 3
    Clementine
    Clementine
    Clementine is a multi-platform music
    player and library organizer inspired by
    Amarok 1.4. It has a fast and
    easy-to-use interface, and allows you to
    search and ...
    Download Clementine
  • 4
    XISMuS
    XISMuS
    ATTENTION: Cumulative update 2.4.3 has
    been released!! The update works for any
    previous 2.x.x version. If upgrading
    from version v1.x.x, please download and
    i...
    Download XISMuS
  • 5
    facetracknoir
    facetracknoir
    Modular headtracking program that
    supports multiple face-trackers, filters
    and game-protocols. Among the trackers
    are the SM FaceAPI, AIC Inertial Head
    Tracker ...
    Download facetracknoir
  • 6
    PHP QR Code
    PHP QR Code
    PHP QR Code is open source (LGPL)
    library for generating QR Code,
    2-dimensional barcode. Based on
    libqrencode C library, provides API for
    creating QR Code barc...
    Download PHP QR Code
  • 7
    Cuckoo Sandbox
    Cuckoo Sandbox
    Cuckoo Sandbox uses components to
    monitor the behavior of malware in a
    Sandbox environment; isolated from the
    rest of the system. It offers automated
    analysis o...
    Download Cuckoo Sandbox
  • More »

Linux commands

  • 1
    acl_gran
    acl_gran
    rsbac-admin - Rule Set Based Access
    Control DESCRIPTION: rsbac-admin is a
    set of tool used to manage systems using
    a Rule Set Based Access Control (RSBAC)
    kern...
    Run acl_gran
  • 2
    acl_grant
    acl_grant
    rsbac-admin - Rule Set Based Access
    Control DESCRIPTION: rsbac-admin is a
    set of tool used to manage systems using
    a Rule Set Based Access Control (RSBAC)
    kern...
    Run acl_grant
  • 3
    cpupower-idle-set
    cpupower-idle-set
    cpupower idle-set - Utility to set cpu
    idle state specific kernel options
    SYNTAX: cpupower [ -c cpulist ]
    idle-info [options] DESCRIPTION: The
    cpupower idle-se...
    Run cpupower-idle-set
  • 4
    cpupower-info
    cpupower-info
    cpupower-info - Shows processor power
    related kernel or hardware
    configurations ...
    Run cpupower-info
  • 5
    g15daemon
    g15daemon
    g15daemon - provides access to extra
    keys and the LCD available on the
    logitech G15 keyboard. DESCRIPTION:
    G15Daemon allows users access to all
    extra keys by d...
    Run g15daemon
  • 6
    g15ladi
    g15ladi
    laditools - tools to control and
    monitor LADI (JACK and ladish) systems ...
    Run g15ladi
  • More »

Ad