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).
As matrixmadhan already pointed out, It's because you're trying to match *\n (filename expansion occurs after word splitting):
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)