If you have the xxd utility available (part of vim I think), pipe the file into it. Take the hexadecimal code for the strange character, convert it to octal, and the you can use command substitution + echo to have sed remove it.
Hi,
We have a DEC Alpha 4100 Server with OSF1 Digital Unix 4.0.
Can any one tell me, if there are any commands on this Unix which are equivalent to "top" and "sar" on HP-UX or Sun Solaris ?
I am particularly interested in knowing the CPU Load, what process is running on which CPU, etc.
... (1 Reply)
both ksh/bash support this 2 special variables, Is there any document for reference?
1) "-" is $OLDPWD
2) "$_" is last argument of previous command. (4 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this:
$ look "string" "/home/patrick/filename.txt"
However, this gives me the following message:
"look: /home/patrick/filename.txt: File too large"
So, I have two... (14 Replies)
Hello All,
I have an Expect script that ssh's to a remote server and runs some commands before exiting.
One of the commands I run is the "hostname" Command. After I run this command I save the output
using this line in the code below...
Basically it executes the hostname command, then I... (2 Replies)
Hi Experts.
I'm stuck with the below AWK code where i'm trying to move the records containing any special characters in the last field to a bad file.
awk -F, '{if ($NF ~ /^|^/) print >"goodfile";else print >"badfile"}' filename
sample data
1,abc,def,1234,A *
2,bed,dec,342,* A ... (6 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hello !
I'm quite new to linux but haven't found a script to do this task, unfortunately my knowledge is quite limited on shellscripts...
Could you guys help me removing the duplicate lines of a file, based only on a single "column"?
For example:
M202034357;01/2008;J30RJ021;Ciclo 01... (4 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 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)