10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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)
Discussion started by: javajockey
4 Replies
2. Shell Programming and Scripting
Hi,
My first shell script is one that prints the five largest directories in a given directory. My current effort is as follows, it gives me the output I'd like, but I have to quote a globbed pathname, which seems wrong:
#!/bin/sh
du -hs $1 | sort -rn | head -n 5
And I must invoke... (2 Replies)
Discussion started by: aardymir
2 Replies
3. UNIX for Dummies Questions & Answers
I have some large login files that I need to extract (user)@(server) from. Where it gets tricky is that there is usually more than one '@' sign on each line(although it does have a leading space if it's not part of the (user)@(server) string), I need only the (user)@(server) section, I need only... (6 Replies)
Discussion started by: Mordaris
6 Replies
4. Shell Programming and Scripting
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)
Discussion started by: mcframe
4 Replies
5. Shell Programming and Scripting
This post is in reference to https://www.unix.com/shell-programming-scripting/137977-tricky-sed-awk-question-post302428154.html#post302428154
I am trying to go the opposite direction now:
I have the following file:
a,b,C,f,g
a,b,D,f,g
a,b,E,f,g
h,i,J,k,l
m,n,O,t,u
m,n,P,t,u
m,n,Q,t,u... (3 Replies)
Discussion started by: awayand
3 Replies
6. Shell Programming and Scripting
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)
Discussion started by: Bubnoff
4 Replies
7. Shell Programming and Scripting
hi guys, i have a question related to quoting but i am not sure how to formulate it...
lets say we want to simulate the following shell actions
cd ~/project-dir
ctags /home/work/folder1/*.sh /home/work/folder2/*.sh /home/work/folder3/*.sh
so i make the following script
buidtags.sh
... (2 Replies)
Discussion started by: aegis
2 Replies
8. Shell Programming and Scripting
The block below isn't a surprise:$ ls
file1 file2 file3
$ x=*
$ echo $x
file1 file2 file3
$ echo '$x'
$x
$ echo "$x"
*
$But I found this block a bit bewildering:$ echo $x'
>'
*
$I'm wondering why substitution wasn't performed on the $x, since it was unquoted (as far as I can tell).... (5 Replies)
Discussion started by: na5m
5 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I am at a point in my script where I defined the number of the command line parameter I would like to set a variable equal to:
parameter_number=14
I would then like to set a variable equal to the correct parameter:
variable=$parameter_number
The issue here is that {} is required... (2 Replies)
Discussion started by: msb65
2 Replies
10. Shell Programming and Scripting
Hi,
I'm in the midst of writing a UNIX script that sftp's files to an external host and am stuck with a problem. The problem is that the files created on my server as a order number that correlates to a sequence of directories on the remote host which is where the file should be ftp'ed.
... (3 Replies)
Discussion started by: budrito
3 Replies