Hi i am trying to write a perl program where i have to open a
1)directory "unit"
2) rename the files in the dir say file1.txt;file2.txt...file5.txt
to file1_a.txt;file2_a.txt,....file5_a.txt ;file1_x.txt ;file2_x.txt
3) open these renamed files and replace the words
lets say file1_a.txt... (7 Replies)
I'm trying to find a exact word match but couldn't do it.
ABC
ABC_NE
Searching for ABC_NE tried
grep -w </ABC_NE/>
grep "^ABC_NE$"
but didn't worked , any awk variants would also help.
---------- Post updated at 08:40 AM ---------- Previous update was at 06:48 AM ----------
I... (2 Replies)
i have a file with the below content
file1.txt
ALERTADMIN.FIELD
ALERTADMIN.TX_ALERTS_LOG
i have another file
file2
ALERTADMIN.FIELD
ALERTADMIN.FIELD_WS
ALERTADMIN.SECTION_FIELD_WS
ALERTADMIN.TX_ACCT_PROCESSING_WORK_TABLE
ALERTADMIN.TX_ACCT_REVIEW_EXEC_METRICS... (2 Replies)
I have a file that has the words I want to find in other files (but lets say I just want to find my words in a single file). Those words are IDs, so if my word is ZZZ4, outputs like aaZZZ4, ZZZ4bb, aaZZZ4bb, ZZ4, ZZZ, ZyZ4, ZZZ4.8 (or anything like that) WON'T BE USEFUL.
I need the whole word... (6 Replies)
QUESTION1:
How do you grep only an exact string. I am using Solaris10 and do not have any GNU products installed.
Contents of car.txt
CAR1_KEY0
CAR1_KEY1
CAR2_KEY0
CAR2_KEY1
CAR1_KEY10
CURRENT COMMAND LINE: WHERE VARIABLE CAR_NUMBER=1 AND KEY_NUMBER=1
grep... (1 Reply)
This may be stupid question but not able to solve it.
How to grep exact word and line along with it.
TEST:/u00/app/oracle/product/10.2.0/TEST:N
TEST2:/u00/app/oracle/product/10.2.0/ODS:N
TEST3:/u00/app/oracle/product/10.2.0/TEST:N
TEST4:/u00/app/oracle/product/10.2.0/ODS:N... (4 Replies)
Hi,
I want to search for a specific word in file and replace whole line with new text.
e.g.
1) I have file with below lines
APP=ABCD 12/12/2012
DB=DDB 01/01/2013
I need perl command which will check for APP=$VAL and replace whole line with APP=$NEWVAL $NEWDT
Simlarly need a... (2 Replies)
Hi
i am writing and i want to take very first word "A924A5FC"from the below o/p
A924A5FC 0910055313 P S SYSPROC SOFTWARE PROGRAM ABNORMALLY TERMINATED
A924A5FC 0908091913 P S SYSPROC SOFTWARE PROGRAM ABNORMALLY TERMINATED
A924A5FC 0906090313 P S SYSPROC SOFTWARE... (4 Replies)
Discussion started by: scriptor
4 Replies
LEARN ABOUT DEBIAN
shelltest
SHELLTEST(1) version 1.2.1 SHELLTEST(1)NAME
shelltestrunner - test command-line programs or arbitrary shell commands
SYNOPSIS
shelltest [options] {testfiles|testdirs}
DESCRIPTION
shelltestrunner tests command-line programs (or arbitrary shell commands). It reads simple declarative tests specifying a command, some
input, and the expected output, and can run them run in parallel, selectively, with a timeout, in color, and/or with differences high-
lighted.
OPTIONS -a, --all
Show all failure output, even if large
-c, --color
Show colored output if your terminal supports it
-d, --diff
Show failures in diff format
-p, --precise
Show failure output precisely (good for whitespace)
-x STR, --exclude=STR
Exclude test files whose path contains STR
--execdir
Run tests from within the test file's directory. Test commands normally run within your current directory; --execdir makes them run
within the directory where they are defined, instead.
--extension=EXT
Filename suffix of test files (default: .test)
-w, --with=EXECUTABLE
Replace the first word of (unindented) test commands. This option replaces the first word of all test commands with something else,
which can be useful for testing alternate versions of a program. Commands which have been indented by one or more spaces will not
be affected by this option.
--debug
Show debug info, for troubleshooting
--debug-parse
Show test file parsing info and stop
--help-format
Display test format help
-?, --help
Display help message
-V, --version
Print version information
-- TFOPTIONS
Set extra test-framework options like -j/--threads, -t/--select-tests, -o/--timeout, --hide-successes. Use -- --help for a list.
Avoid spaces.
DEFINING TESTS
Test files, typically named tests/*.test, contain one or more tests consisting of:
o a one-line command
o optional standard input (<<<), standard output (>>>) and/or standard error output (>>>2) specifications
o an exit status (>>>=) specification
Test format:
# optional comment
the command to test
<<<
zero or more lines of standard input
>>>
zero or more lines of expected standard output
(or /REGEXP/ added to the previous line)
>>>2
zero or more lines of expected standard error output
(or /REGEXP/ added to the previous line)
>>>= EXITCODE (or /REGEXP/)
o A /REGEXP/ pattern may be used instead of explicit data. In this case a match anywhere in the output allows the test to pass. The regu-
lar expression syntax is regex-tdfa (http://hackage.haskell.org/package/regex-tdfa)'s.
o EXITCODE is a numeric exit status (http://en.wikipedia.org/wiki/Exit_status), eg 0 for a successful exit.
o You can put ! before a /REGEXP/ or EXITCODE to negate the match.
o Comment lines beginning with # may be used between tests.
EXAMPLES
Here's example.test, a file containing two simple tests:
# 1. let's test that echo runs. Numbering your tests can be helpful.
echo
>>>= 0
# 2. and now the cat command. On windows, this one should fail.
cat
<<<
foo
>>>
foo
>>>= 0
Run it with shelltest:
$ shelltest example.test
:t.test:1: [OK]
:t.test:2: [OK]
Test Cases Total
Passed 2 2
Failed 0 0
Total 2 2
AUTHORS
Simon Michael.
shelltestrunner March 18 2012 SHELLTEST(1)