Search Results

Search: Posts Made By: johnprogrammer
4,966
Posted By johnprogrammer
There are logical errors in the code. For...
There are logical errors in the code.

For example

for dir in /home/cmccabe/medex.logs/ponc/*/ ; do

if [ -d "$dir" ] ; then
run="$(basename "$dir")"
fi


$run is always *
...
8,688
Posted By johnprogrammer
Shutdown is a system-wide action, and requires...
Shutdown is a system-wide action, and requires root privileges in some UNIX systems (macOS included).

This means, if you want to have shutdown as an option in a script, you will need to give the...
4,966
Posted By johnprogrammer
Your code typo corrected. It is POSIX shell...
Your code typo corrected. It is POSIX shell compliant, and it works with Bash too.


#!/bin/sh

# POSIX shell compliant.

# grab run directory.
set -xv

for dir in...
4,966
Posted By johnprogrammer
I think I finished your program. Test it, and...
I think I finished your program. Test it, and tell us if it works.


#!/bin/sh

# POSIX shell compliant.

# grab run directory.
set -xv

for dir in /home/cmccabe/medex.logs/ponc/*/ ; do

...
9,110
Posted By johnprogrammer
It is a macOS thing. You must right click on the...
It is a macOS thing. You must right click on the Terminal icon on the Dock, and select Quit.

See the screenshot attached.
4,098
Posted By johnprogrammer
Here is POSIX shell compliant code, that returns...
Here is POSIX shell compliant code, that returns the full path of a file or directory.


#!/bin/sh

# FullPath subroutine, version 1.0, POSIX shell compliant.

# Copyright © 2019 Ioannis...
9,085
Posted By johnprogrammer
The following code works: #!/bin/sh ...
The following code works:


#!/bin/sh

# POSIX shell compliant.

grep -i "httpd" input.txt | sed "s/ //" | sed "s/ //" |sed "s/(/ (/"

exit 0
2,267
Posted By johnprogrammer
I completed the code: #!/bin/sh # Code...
I completed the code:

#!/bin/sh

# Code is POSIX compliant

tput clear

currentDate="$(date -R)"


counter=0

for word in $currentDate
do

# We ignore the day of the week.
if [...
2,267
Posted By johnprogrammer
I am new to shell programming, here is what I...
I am new to shell programming, here is what I did.


#!/bin/sh

# Code is POSIX compliant


currentDate="$(date -R)"


counter=0

for word in $currentDate
do

# We ignore the day of...
Showing results 1 to 9 of 9

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