Search Results

Search: Posts Made By: RudiC
175
Posted By RudiC
In your first script, you're both too generous,...
In your first script, you're both too generous, and not enough, with "command substitutions". Try
for i in "${SERVICES[@]}"
do pgrep $i >/dev/null
STATS=$?
if [ $STATS == 0 ...
303
Posted By RudiC
I'm helpless with that little context you give....
I'm helpless with that little context you give. What's so special with those files? Does tar work without the gzip? Does it work with other files, e.g simple text files? In another directory? Without...
200
Posted By RudiC
Try su's -c option.
Try su's -c option.
198
Posted By RudiC
What ksh version do you have? man ksh93 : ...
What ksh version do you have?

man ksh93 :




Try
[[ $string2 =~ ROS[0-9]*$ ]] && echo OK || echo NOK
OK
303
Posted By RudiC
I'm baffled to learn the AIX tar version doesn't...
I'm baffled to learn the AIX tar version doesn't provide the z option.


Writing the tar red output to a file (-f /backup/App_Bckup.tar) will prevent it to write to stdout, i.e. the pipe to...
370
Posted By RudiC
Again: too many escapes. Drop one of the two back...
Again: too many escapes. Drop one of the two back slashes in the read delimiter's -d definition. Same for ALL the escaped double quotes around file and directory names downstream.


Sure your...
123
Posted By RudiC
No surprise. If the grep "command substitution"...
No surprise. If the grep "command substitution" delivers the "empty" value, ls-l uses the default: . . man ls:

Add a certainly non-existent file name (difficult to find, as there are almost no...
370
Posted By RudiC
Drop the escaped double quotes in find's...
Drop the escaped double quotes in find's "starting point". find does allow multiple "starting points", BTW.
370
Posted By RudiC
Hmmm - I don't see...
Hmmm - I don't see /volume1/Archive/IMAGES/UPLOAD/DNG/ referenced anywhere in your script - that error msg can't come from that script. Does the DNG directory exist in the path?
137
Posted By RudiC
That space is the OFS between $1 and $2. Try like...
That space is the OFS between $1 and $2. Try like


awk '
BEGIN {for (i=split("JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC", month); i; i--) mdigit[month[i]] = i
}
{$1 =...
428
Posted By RudiC
I don't know why sudo kill PID should not work. ...
I don't know why sudo kill PID should not work.


Another twothree comments:
- bash provides the PID of the last process put in background in the $! variable (man bash).
- suppress ps' heading...
428
Posted By RudiC
I can't reproduce that specific error with the...
I can't reproduce that specific error with the script you posted. Sure you posted the correct and complete one?


Two comments:
- The #! token ("shebang") HAS to be the first two chars of a...
268
Posted By RudiC
Does your shell provide the select builtin?...
Does your shell provide the select builtin? Which, in combination with the case ... esac construct, helps building menus in a simple way.
421
Posted By RudiC
This MAY work to identify the target files. It...
This MAY work to identify the target files. It produces an archive listing in long format including the date/time stamps, which ($4,$5) then are printed to stdout and a pipe, and, in parallel, the...
421
Posted By RudiC
I'm afraid you're out of luck. Not all tar...
I'm afraid you're out of luck. Not all tar versions provide a --delete option; e.g.

tar --version
bsdtar 2.8.4 - libarchive 2.8.4
doesn't. Those which do, like
tar --version
tar (GNU tar) 1.30...
295
Posted By RudiC
Show your awk attempts and non-satisfying results.
Show your awk attempts and non-satisfying results.
491
Posted By RudiC
Or awk -F, ' {print $0 FS...
Or
awk -F, '
{print $0 FS substr($NF,($3=="bcd") ? 4 : 9, 1)}
' file
345
Posted By RudiC
Now, where to start? - With your syntax...
Now, where to start?


- With your syntax errors?

Beyond bash: syntax error near unexpected token `else', there are
'[' 100652 -ge 235900 ']' -a '[' 100652 -le 060000 ']'
bash: [: too many...
1,018
Posted By RudiC
How about this one, no $arg needed: sed -e...
How about this one, no $arg needed:
sed -e '1,// {/Listen/r add.txt' -e'}' ssl.confwhich checks from line #1 till /Listen/ is encountered the first time. The trick is "reusing" the "previous regular...
491
Posted By RudiC
@nezabudka: You are right if the last field is...
@nezabudka: You are right if the last field is well-formed, i.e. >= 4 chars. Compare the versions for the case of last field < 4 char...
228
Posted By RudiC
With a help file in $SEV defining severity order...
With a help file in $SEV defining severity order in the form


1 CRITICAL
3 HIGH
6 LOW
2 MAJOR
4 MEDIUM
5 MINOR



try also


grep -Eo "[0-9]*...
491
Posted By RudiC
And, the .* would allow for one or more...
And, the .* would allow for one or more comma-separated fields, both in the middle as well as at line end. You might want to anchor the regex at line end, too. Proposal (untested)


sed -r...
Forum: Shell Programming and Scripting 2 Weeks Ago
828
Posted By RudiC
Try as given in example above # m h dom...
Try as given in example above


# m h dom mon dow user command
17 * * * * root run-parts --report /etc/cron.hourly


would yield

0 * * * * test /script_path/my_script.sh
Forum: Shell Programming and Scripting 2 Weeks Ago
828
Posted By RudiC
Use the system-wide /etc/crontab that allows a...
Use the system-wide /etc/crontab that allows a user name to be specified.
504
Posted By RudiC
The OP specified , that's what the formatted...
The OP specified , that's what the formatted sprintf is for. As the sample data are just 10 byte long, not 12, we need to wait until resolved by the OP, we can just guess. Try this simplified but...
Showing results 1 to 25 of 500

 

Featured Tech Videos

All times are GMT -4. The time now is 04:11 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy