The block below isn't a surprise:
But I found this block a bit bewildering:
I'm wondering why substitution wasn't performed on the $x, since it was unquoted (as far as I can tell). Thanks to the guru who can shed light on this one
Does anyone know of a way to mimic the up arrow/down arrow type bash behavior within a shell script?
Say I have a scripted menu, and would like to be able to up arrow to bring up the last X number of lines of user input?
Thanks to anybody with a suggestion. :) (0 Replies)
I can do this on the command line:
sqsh -S 192.168.x.x -o tmp -U user -P fakepass -D horizon -C "\
select second_id
from borrower
where btype like '%wsd%'
"
I can also just leave the SQL at the end intact on one line ....
... However, when I throw this in a script like:
$SQSH -o... (4 Replies)
Hi,
I need to embed a metatag to image files which contain qrcodes, i usually do this with exiv -M "set Exif.Image.DocumentName `zbarimg -q -Sdisable -Sqrcode.enable --raw image.tif`" image.tif
which works fine. However I need to do this recursivly for whole directory and subdiretory... (4 Replies)
Hi all
I am relatively new to linux (specifically red hat). I have installed Fedora 13 on my machine and started playing with the terminal when i found a very strange behavior when typing a command that is not found:
the terminal does not prompt me back. In other words, i am logged as root (or... (4 Replies)
run_xfs_fsr is a xfs filesystem maintenance script designed to run under cron. The system is a home theater personal computer running mythbuntu 10.10, and is accessed remotely for these tests. cron runs a script, (xfs_fsr.sh) at 02:30 that runs the subject script under BASH and sets the... (3 Replies)
I am trying to get my history in sync in multiple bash sections and things aren't working the way I expect.
Desired behavior, hitting esc-K in all bash sessions (same userid and machine) will use the same history.
Observed behavior: Esc-k shows the history of the current session, rather than... (8 Replies)
I have some data files that I can identify by a certain pattern in the names using find.
Every one of those data files has an XML file associated with it (can be multiple data files per XML file).
The XML file is always up one directory from the data file(s) in a folder calledRun##### -... (12 Replies)
I am trying to write a BASH script that will prompt a user to enter a number of days, then calculate the date.
My problem is the date command uses single or double quotes. For Example..
date -d "7 days"
Here is an example of some same code I am trying to work through.
echo "when do you... (4 Replies)
Good Morning
I think there may be something I dont understand fully.
The following code works well, but I dont like the set domen method.
#!/bin/bash
#
domen="y"
while
do
echo " M A I N - M E N U"
echo "1. Contents of /etc/passwd"
echo "2. List of users currently logged"
echo... (10 Replies)
So I'm trying to pass certain json elements as env vars and use them later on in a script.
Sample json:
JSON='{
"Element1": "file-123456",
"Element2": "Name, of, company written in, a very weird way",
"Element3": "path/to/some/file.txt",
}'
(part of the) script:
for s... (5 Replies)
Discussion started by: da1
5 Replies
LEARN ABOUT BSD
diff3
DIFF3(1) General Commands Manual DIFF3(1)NAME
diff3 - 3-way differential file comparison
SYNOPSIS
diff3 [ -exEX3 ] file1 file2 file3
DESCRIPTION
Diff3 compares three versions of a file, and publishes disagreeing ranges of text flagged with these codes:
==== all three files differ
====1 file1 is different
====2 file2 is different
====3 file3 is different
The type of change suffered in converting a given range of a given file to some other is indicated in one of these ways:
f : n1 a Text is to be appended after line number n1 in file f, where f = 1, 2, or 3.
f : n1 , n2 c Text is to be changed in the range line n1 to line n2. If n1 = n2, the range may be abbreviated to n1.
The original contents of the range follows immediately after a c indication. When the contents of two files are identical, the contents of
the lower-numbered file is suppressed.
Under the -e option, diff3 publishes a script for the editor ed that will incorporate into file1 all changes between file2 and file3, i.e.
the changes that normally would be flagged ==== and ====3. Option -x (-3) produces a script to incorporate only changes flagged ====
(====3). The following command will apply the resulting script to `file1'.
(cat script; echo '1,$p') | ed - file1
The -E and -X are similar to -e and -x, respectively, but treat overlapping changes (i.e., changes that would be flagged with ==== in the
normal listing) differently. The overlapping lines from both files will be inserted by the edit script, bracketed by "<<<<<<" and ">>>>>>"
lines.
For example, suppose lines 7-8 are changed in both file1 and file2. Applying the edit script generated by the command
"diff3 -E file1 file2 file3"
to file1 results in the file:
lines 1-6
of file1
<<<<<<< file1
lines 7-8
of file1
=======
lines 7-8
of file3
>>>>>>> file3
rest of file1
The -E option is used by RCS merge(1) to insure that overlapping changes in the merged files are preserved and brought to someone's atten-
tion.
FILES
/tmp/d3?????
/usr/libexec/diff3
SEE ALSO diff(1)BUGS
Text lines that consist of a single `.' will defeat -e.
7th Edition October 21, 1996 DIFF3(1)