12-22-2017
What be the similarities / commonalities of the two tasks, what aspects do they share? Should there be enough of these, it might make sense to consider a merge. But then, the logics needed inside the loop to tell each case from the other might by far outweigh the savings.
One approach could be to collect the files into a compound mput ftp command (in two loops, of course) and run that in one single ftp invocation and login.
BTW, none of the variables used in your above code snippet is defined and thus will lead to failure when running the code.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I'm trying to create a loop that will prompt the user for 15 values, not forcing them to enter all 15. If the user enters through one or more of the prompts the null value needs to be converted to 0, otherwise set the parameter = to the value entered:
ex.
Please enter file no #1: 17920
... (4 Replies)
Discussion started by: vdc
4 Replies
2. UNIX for Dummies Questions & Answers
Hi,
how can I use "for" to have two loops :
this is my script :
for i in (A B C)
do
for j in (a b c)
do
echo $i$j
done
done
#End
I want to print out
Aa
Ab
Ac ....
But I have error message :
syntax error at line 1 : `(' unexpected
Many thanks before.
How should I use "for" ?? (2 Replies)
Discussion started by: big123456
2 Replies
3. Shell Programming and Scripting
Hi
I've a file like so:
Now, I want to read my file and take ex. the Media ID and the Type for each groups of Media (Media1,Media2,...,Media(n):
cat /tmp/file|\
while read FILE
do
while $(FILE|cut -d: -f1)=Media$i
do
#here will be some test, ex:
#if Media ID < 23
... (4 Replies)
Discussion started by: nymus7
4 Replies
4. UNIX for Dummies Questions & Answers
Hi everyone,
I have a question regarding for loops. I am writing a BASH shell script that will contain multiple loops. These loops all involve looping with a count:
for (( a=0; a <=10; a++ )); do
echo $a
done
If none of my multiple loops relate to each other throughout the script,... (3 Replies)
Discussion started by: msb65
3 Replies
5. Shell Programming and Scripting
Hi All,
I want to execute a script the number of times a user enters. Please can you advise on hor can I do the same.
Many Thanks,
Shazin (4 Replies)
Discussion started by: Shazin
4 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I'm not sure if this is more appropriate for the 'unix for dummies' or the 'unix for experts' forum because I'm new to this forum and this is the second topic I've discussed, but if you could let me know which one was more appropriate for something like this, please do!
So in tr (an... (2 Replies)
Discussion started by: juliette salexa
2 Replies
7. Shell Programming and Scripting
Hi All
I have some directories on our server which are containing .csv files. i need to print value of cell "B2" from those csv files. Please advise.
I have tried head command as example: head -2 */Book_Collection_Report_1_-_Collection_Requests_trials.csv | sed -n "3p" | awk -F","... (4 Replies)
Discussion started by: yash1978
4 Replies
8. Shell Programming and Scripting
Hi All,
I am very new to Shell scripting. I read basic scripting manual. But i didn't understand the code. Please tell the meaning of the below code:
while getopts "F:f:R:r:C:c:" opt 2>/dev/null
do
case ${opt} in
F|f) FREQUENCY_MODE=$OPTARG;;
... (3 Replies)
Discussion started by: pdathu
3 Replies
9. UNIX for Advanced & Expert Users
I'm trying to understand better the while and until loops, can someone help me with this example?
#!/bin/bash
# Listing the planets.
for planet in Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune Pluto
do
echo $planet # Each planet on a separate line.
done
echo; echo
for... (3 Replies)
Discussion started by: jose2802
3 Replies
10. UNIX for Dummies Questions & Answers
Why wont my for statements work? Im trying to get this script to swich to a user an if you put in a start/stop/or restart paramater to do just that for each user. I commented out the actual start/stop actions to test it just by using echos and not do anything hasty in the environment but it... (0 Replies)
Discussion started by: LilyClaro
0 Replies
LEARN ABOUT CENTOS
systemd-tmpfiles-clean.timer
SYSTEMD-TMPFILES(8) systemd-tmpfiles SYSTEMD-TMPFILES(8)
NAME
systemd-tmpfiles, systemd-tmpfiles-setup.service, systemd-tmpfiles-setup-dev.service, systemd-tmpfiles-clean.service, systemd-tmpfiles-
clean.timer - Creates, deletes and cleans up volatile and temporary files and directories
SYNOPSIS
systemd-tmpfiles [OPTIONS...] [CONFIGFILE...]
systemd-tmpfiles-setup.service
systemd-tmpfiles-setup-dev.service
systemd-tmpfiles-clean.service
systemd-tmpfiles-clean.timer
DESCRIPTION
systemd-tmpfiles creates, deletes, and cleans up volatile and temporary files and directories, based on the configuration file format and
location specified in tmpfiles.d(5).
If invoked with no arguments, it applies all directives from all configuration files. If one or more filenames are passed on the command
line, only the directives in these files are applied. If only the basename of a configuration file is specified, all configuration
directories as specified in tmpfiles.d(5) are searched for a matching file.
OPTIONS
The following options are understood:
--create
If this option is passed, all files and directories marked with f, F, w, d, D, p, L, c, b, m in the configuration files are created or
written to. Files and directories marked with z, Z, m have their ownership, access mode and security labels set.
--clean
If this option is passed, all files and directories with an age parameter configured will be cleaned up.
--remove
If this option is passed, all files and directories marked with r, R in the configuration files are removed.
--boot
Also execute lines with an exclamation mark.
--prefix=PATH
Only apply rules that apply to paths with the specified prefix. This option can be specified multiple times.
--exclude-prefix=PATH
Ignore rules that apply to paths with the specified prefix. This option can be specified multiple times.
--help
Prints a short help text and exits.
It is possible to combine --create, --clean, and --remove in one invocation. For example, during boot the following command line is
executed to ensure that all temporary and volatile directories are removed and created according to the configuration file:
systemd-tmpfiles --remove --create
EXIT STATUS
On success, 0 is returned, a non-zero failure code otherwise.
SEE ALSO
systemd(1), tmpfiles.d(5)
systemd 208 SYSTEMD-TMPFILES(8)