Search Results

Search: Posts Made By: johnprogrammer
4,018
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 *
...
4,018
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

...
4,018
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...
7,353
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...
7,915
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.
7,538
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
3,367
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...
1,985
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 [...
1,985
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 11:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy