10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In the bash below the variable date displays in the echo. However when I use it in the for loop it does not. Basically, the user inputs a date then that date is converted to the desired format of (month-day-year, no leading 0). That input is used in the for loop to return every file that matches... (5 Replies)
Discussion started by: cmccabe
5 Replies
2. UNIX for Advanced & Expert Users
Hello Gurus :)
I'm "currently" (for the last ~2weeks) writing a script to build ffmpeg with some features from scratch.
This said, there are quite a few features, libs, to be downloaded, compiled and installed, so figured, writing functions for some default tasks might help.
Specialy since... (3 Replies)
Discussion started by: sea
3 Replies
3. Shell Programming and Scripting
I have a file that has 2 fields called b_file:
11977 DAR.V3.20150209.1.CSV
3295 DAR.V3.20150209.1.CSV
1721 DAR.V2.20150210.1.CSV
I need to search a sftplog using the field 1, but want to maintain the relationship between field 1 and 2. I am passing field 1 as a parameter in a bash loop.
... (14 Replies)
Discussion started by: smenago
14 Replies
4. Shell Programming and Scripting
Hi,
I want to capture space as well from the argument
eg:
script.ksh -m "Message from xyz" -e "email@xyz.com"
script.ksh -m 'Message from xyz' -e 'email@xyz.com'
I am parsing using getopts, but for option "m" OPTARG is returning only "Message".
Please use code tags next time for... (9 Replies)
Discussion started by: tostay2003
9 Replies
5. Shell Programming and Scripting
Heyas
Just recently there was a thread about parsing arguments, where i read the first time about getopts.
This said, i'd like to 'provide' a list function that can be 'trigered' using an 'option'(?).
The regarding code snippets are:
while getopts... (7 Replies)
Discussion started by: sea
7 Replies
6. Shell Programming and Scripting
How can I say one of the options is required? can I use an if statement?
let say:
while getopts ":c:u:fp" opt; do
case $opt in
c) echo "-c was triggered, Parameter: $OPTARG" >&2;;
u) echo "-u was triggered, Parameter: $OPTARG" >&2;;
f) echo "-u was triggered,... (2 Replies)
Discussion started by: bashily
2 Replies
7. Shell Programming and Scripting
Hi,
Unexpectedly, the function below doesn't seem to work
when called a second time. The output shows that when
the function is called the first time, it works as expected
but when it is called a second time, the loop that processes
the options passed to the function, with the while loop,... (2 Replies)
Discussion started by: ASGR
2 Replies
8. Shell Programming and Scripting
Hi, I am trying to do this thing useing my shell bash ( sorry for my english )
I have in a file 63 hostnames, i wanna ask to the DHCP admin, to reserv that reserves 63 IP addresses of this hosts, using their mac address.
I have thinked this script:
for ((i=1;i<63;i++)); do
arp $(head... (10 Replies)
Discussion started by: Cypress
10 Replies
9. Shell Programming and Scripting
Hi all..
Does anyone know have an example of passing the contents of a bash array to oracle?
basically I am looking to loop through the contents of a file(not csv!) and store each line into a bash array. Once i have this I can then pass the array into an oracle procedure that accepts an array... (1 Reply)
Discussion started by: satnamx
1 Replies
10. Shell Programming and Scripting
I need to check if $1 or $2 are empty before continuing but I don't know if bash has any logic of the sort. This is what I'm looking for - except that "and" doesn't seem to work.
if and ;then
...
Thank you! :D (4 Replies)
Discussion started by: ph0enix
4 Replies