Hi All
I have a function in a Linux script as follows
But when its executed its throwing error like
In the funtion line 145 is the one which is marked in bold in the above first code.
I am not able to figure out why is this error coming.
Can anyone please help me on this.
I need to print some mandatory instructions if something fails in the script. I am using set -e to check and exit the script if some scripts/commands return non zero exit code. Is there any way to print these instructions with set command?? (0 Replies)
Hello all,
Here is what my bash script does: sums number columns, saves the tot in new column, outputs if tot >= threshold val:
> cat getnon0file.sh
#!/bin/bash
this="getnon0file.sh"
USAGE=$this"
InFile="xyz.38"
Min="0.05"
#
awk '{sum=0; for(n=2; n<=NF; n++){sum+=$n};... (4 Replies)
I'm reading about debugging aids in bash and have come across the set command. It says in my little book that an addition to typing
set
you can also use them "on the command line when running a script..." and it lists this in a small table:
set -o option Command Line... (5 Replies)
Hi all!
I have a data set in this tab separated format : Label, Value1, Value2
An instance is "data.txt" :
0 1 1
-1 2 3
0 2 2
I would like to parse this data set and generate two files, one that has only data with the label 0 and the other with label -1, so my outputs should be, for... (1 Reply)
Hi,
Will following set up work in bash script? I've got errors if assigning following binary command to a variable. But on the other hand, COMMAND="ls" works. Any explanation please? How can I assign binary command to a variable COMMAND then I can just call ${COMMAND}?
COMMAND="rsync"... (3 Replies)
Hi,
I am looking for a shell script which serves the below purpose.
Please find below the algorithm for the same and any help on this would be highly appreciated.
1)set of strings need to be replaced among set of files(directory may contain different types of files)
2)It should search for... (10 Replies)
Hi Guys,
I like to output every command executed in the script to a file.
I have tried set -x which does the same.
But it is not giving the logs of the child script which is being called from my script.
Is there any parameters in the Set command or someother way where i can see the log... (2 Replies)
Discussion started by: mac4rfree
2 Replies
LEARN ABOUT DEBIAN
rrep
RREP(1) General Commands Manual RREP(1)NAME
rrep - replace patterns in files.
SYNOPSIS
rrep [OPTIONS] PATTERN REPLACEMENT [FILE...]
DESCRIPTION
The rrep utility searches input FILEs for matches to a given PATTERN and replaces those matches by a given REPLACEMENT. The pattern is, by
default, a basic regular expression. The replacement string may contain special characters to refer to portions of the matched pattern.
Binary files are, by default, ignored. A file is regarded as binary if it contains the null character.
OPTIONS -E, --extended-regexp
PATTERN is interpreted as an extended regular expression (ERE).
-F, --fixed-strings
PATTERN and REPLACEMENT are interpreted as fixed strings, not as regular expressions or escape sequences.
-R, -r, --recursive
Each directory that is given on the command line is processed recursively. Files and sub-directories starting with the . character
are, by default, ignored.
--include=FILE_PATTERN
Only files are processed that match the pattern FILE_PATTERN, except for files that are specifically given on the command line. *,
?, and [...] can be used as wildcards in FILE_PATTERN. Wildcards and backslash characters can be quoted with .
--exclude=FILE_PATTERN
Files that match the pattern FILE_PATTERN will be skipped, except for files that are specifically given on the command line (using
wildcard matching as described under --include).
--exclude-dir=PATTERN
Directories that match PATTERN will be skipped, except for files that are specifically given on the command line (using wildcard
matching as described under --include).
-V, --version
Print the version number of rrep.
-S SUFFIX, --suffix=SUFFIX
Override default backup suffix. This option implicitly activates backups.
-a, --all
Files and sub-directories starting with the . character in recursively processed directories (see --recursive) are processed as
well.
-b Backup before overwriting files. The backup files are written into the directory of the original file. Equivalent to using
--backup=existing.
--backup[=CONTROL]
Like -b but accepts a version control argument. The file name of the backup file is appended by a ~ character. The backup suffix is
~, unless set with --suffix or SIMPLE_BACKUP_SUFFIX. The version control method may be selected via the --backup option or through
the VERSION_CONTROL environment variable. Here are the values:
none, off never make backups
(even if --backup is given)
numbered, t make numbered backups
existing, nil numbered if numbered backups exist, simple
otherwise
simple, never always make simple backups
--binary
Do not ignore binary files. A file is regarded as binary if it contains the null character .
--dry-run
The replacement is just simulated. No file is actually modified.
-e PATTERN, --regexp=PATTERN
Use PATTERN for matching. This option can be used to specify a pattern beginning with -.
-h, --help
Display a help message that descibes the command line options and exit afterwards.
-i, --ignore-case
Case distinctions in PATTERN are ignored.
--keep-times
The original access and modification times of files and directories are restored after processing.
-p REPLACEMENT, --replace-with=REPLACEMENT
Use REPLACEMENT for substitution.
--interactive
Each time before a file is modified the user is prompted and can cancel the modification.
-q, --quiet, --silent
All normal output messages are suppressed.
-s, --no-messages
All error messages are suppressed.
-w, --word-regexp
Only those matches of PATTERN are replaced that match whole words.
-x, --line-regexp
Only those matches of PATTERN are replaced that match whole lines.
EXIT STATUS
Exit status is 1 if any error occurs, 0 otherwise.
AUTHOR
Written by Arno Onken.
REPORTING BUGS
If you find a bug in rrep, please send electronic mail to <asnelt@asnelt.org>. Include the version number, which you can find by running
rrep --version. Also include in your message the output that the program produced and the output you expected.
If you have other questions, comments or suggestions about rrep, contact the author via electronic mail to <asnelt@asnelt.org>. The author
will try to help you out, although he may not have time to fix your problems.
COPYRIGHT
Copyright 2011 Arno Onken
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
SEE ALSO
Regular Manual Pages
find(1), grep(1), sed(1), xargs(1), regex(7).
TeXinfo Documentation
The full documentation for rrep is maintained as a TeXinfo manual. If the info and rrep programs are properly installed at your site, the
command
info rrep
should give you access to the complete manual.
User Commands rrep 1.3.3 RREP(1)