Search Results

Search: Posts Made By: RudiC
Forum: Shell Programming and Scripting 16 Hours Ago
82
Posted By RudiC
Shouldn't that be read user_name ...
Shouldn't that be
read user_name # no "$", no expansion
if grep $user_name /etc/passwd; then ... # no "[" (test) command, no "command substitution" - use grep's exit...
Forum: Shell Programming and Scripting 23 Hours Ago
119
Posted By RudiC
It does. In each of the individual and (sort of)...
It does. In each of the individual and (sort of) independent shell / subshell levels. Look at it as having TWO variables called TOTAL, one in the parent shell, the second in the subshell,...
86
Posted By RudiC
Please always add info on your system, like OS...
Please always add info on your system, like OS and shell versions, and the (relevant part of the) script as well, to keep people from guessing.


My guess is you're using bash's read -p builtin....
80
Posted By RudiC
Try sed -n '/row/ {:L; N; /\/row/ !bL;...
Try
sed -n '/row/ {:L; N; /\/row/ !bL; /<source_name>19<\/source_name>/ p; }' file
When found row, collect following lines until /row, and if the pattern space contains source...19..., print, else...
119
Posted By RudiC
That's because with common shells (e.g. bash)...
That's because with common shells (e.g. bash) variables defined / created in a subshell (the while loop) are not handed back to the parent shell.


Try also
echo $(( $(grep "Virus" file | grep -o...
119
Posted By RudiC
How about touch file{1..10..2}{a..z}
How about touch file{1..10..2}{a..z}
208
Posted By RudiC
You may want to try this: cd out ls -1 */* | ...
You may want to try this:
cd out
ls -1 */* |
while IFS="/_" read _ PRFX _
do echo "${PRFX%%.*}"
done |
sort -u |
while read DN
do echo mkdir "$DN"
ls */"$DN"* |
...
117
Posted By RudiC
I am not aware of Oracle being able to output...
I am not aware of Oracle being able to output EXCEL workbooks, i.e. binary files. What it can do, and what you already deploy, is outputting .csv style files, if need be with different field / column...
191
Posted By RudiC
Any attempts / ideas / thoughts from your side?
Any attempts / ideas / thoughts from your side?
239
Posted By RudiC
Try this adaption of nezabudka's proposal to...
Try this adaption of nezabudka's proposal to support both structures:
sed -n '/DISTINCT/,/quit/{s/^.*: //; p}' file, or try also

awk '/202[0-9 :,-]*/ {sub ("^.*" $9, "")} /SELECT/, /quit/' file
386
Posted By RudiC
Follow ChublerXL advice. Use a less complex...
Follow ChublerXL advice. Use a less complex script, one or two lines, echoes; redirect stderr, too. Post the log files.
582
Posted By RudiC
Looks like your shell version doesn't provide...
Looks like your shell version doesn't provide that construct. What is it?
386
Posted By RudiC
Good news, no? What about my other...
Good news, no?


What about my other proposals?
386
Posted By RudiC
Add logging to your script! Anything in...
Add logging to your script!


Anything in the system logs, along this line?
Apr 2 14:17:02 UsersPC19 CRON[10758]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)Possibly an error...
212
Posted By RudiC
I'm a bit surprised about your output - how come...
I'm a bit surprised about your output - how come it containes seven lines "natasha 0" when looping across one single username only? And three lines of those above the header lines? Sure the tmp files...
386
Posted By RudiC
Did cron log the script's start? Add some logging...
Did cron log the script's start? Add some logging to your script, so you know that it started, and why and when it exited, either to syslog, or a individual log file.
165
Posted By RudiC
How are those paths presented / stored? In shell...
How are those paths presented / stored? In shell variables? Try
V1=/PPC/Cloud_Automation/Applications/APPNAME/Files/Data\ Management/Data...
468
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 ...
Forum: Shell Programming and Scripting 2 Weeks Ago
1,117
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...
517
Posted By RudiC
Try su's -c option.
Try su's -c option.
582
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
Forum: Shell Programming and Scripting 2 Weeks Ago
1,117
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...
Forum: Shell Programming and Scripting 3 Weeks Ago
1,154
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...
352
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...
Forum: Shell Programming and Scripting 3 Weeks Ago
1,154
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.
Showing results 1 to 25 of 500

 

Featured Tech Videos

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