On Thursday and Friday tar all contents of /etc folder into /export/home/shell/test/etc.tar .. do misc logs #Linux/Unix: Shell Programming – 001

#!/bin/ksh

# on every thursday and friday tar all contents of /etc folder into /export/home/shell/test/. On thursday only create a log file with the list of files
#in the tar file. On thursday untar /export/home/shell/test/etc.tar into vfstab . Then log vfstab exist or not information

DAY=`date +%a`
DATESTAMP=`date +%m-%d-%Y-%H:%M`

if [[ “$DAY” == Mon ]]
then

echo “Today is Monday”

elif [[ “$DAY” == Tue ]]
then

echo “Today is Tuesday”

elif [[ “$DAY” == Wed ]]
then

echo “Today is Wednesday”

elif [[ “$DAY” == Thu ]]
then

echo “Today is Thursday” >> /export/home/shell/test/log/backup-$DATESTAMP.log
cd /etc
tar cvf /export/home/shell/test/etc.tar * >> /export/home/shell/test/log/backup-$DATESTAMP.log
cd /export/home/shell/test
tar xvf etc.tar vfstab

if [[ -f vfstab ]]
then
echo “file vfstab exist” >> /export/home/shell/test/log/backup-$DATESTAMP.log
else
echo “file vfstab does not exist” >> /export/home/shell/test/log/backup-$DATESTAMP.log
fi

elif [[ “$DAY” == Fri ]]
then

echo “Today is Friday”
cd /etc
tar cvf /export/home/shell/test/etc.tar *

elif [[ “$DAY” == Sat ]]
then
echo “Today is Saturday”

else
echo “Today is Sunday”

fi

exit From: http://sitestree.com/?p=12199
Categories:Linux/Unix: Shell Programming – 001
Tags:
Post Data:2018-04-16 19:44:31

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

While Loop Example in Shell Programming. Display a Chart #Linux/Unix: Shell Programming – 001

Example Output

bash-3.2$ ./while-loop-example.sh
Enter your Number
10
10 * 1 = 10
10 * 2 = 20
10 * 3 = 30
10 * 4 = 40
10 * 5 = 50
10 * 6 = 60
10 * 7 = 70
10 * 8 = 80
10 * 9 = 90
10 * 10 = 100


The Code

 

#!/bin/ksh

#example : how to use while loop in shell programming

multiplication()
{

#clear
i=1
while (( i <= 10 ))
do
echo “$Y * $i = `expr $Y * $i`”
(( i = i + 1 ))
done

}

echo “Enter your Number”
read X

case “$X” in

1)
Y=1
multiplication
;;

2)

Y=2
multiplication
;;

3)

Y=3
multiplication
;;

4)

Y=4
multiplication
;;

5)

Y=5
multiplication
;;

6)

Y=6
multiplication
;;

7)

Y=7
multiplication
;;

8)

Y=8
multiplication
;;

9)

Y=9
multiplication
;;

10)

Y=10
multiplication
;;

esac
exit From: http://sitestree.com/?p=12197
Categories:Linux/Unix: Shell Programming – 001
Tags:
Post Data:2018-04-16 19:31:36

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

If then else in shell programming. Count the number of files in current directory, and check … #Linux/Unix: Shell Programming – 001

#!/bin/sh

#count the number of files in current directory, and check if the number is equal to or greater than or less than 26

#NOF represents number of files

NOF=`ls -l | wc -l`

if [ $NOF -eq 26 ]
then
echo “No of files and directories is equal to 26”
fi

if [ $NOF -gt 26 ]
then
echo “No of files is greater than 26”
fi

if [ $NOF -lt 26 ]
then
echo “No of files is less than 26”
fi

exit From: http://sitestree.com/?p=12195
Categories:Linux/Unix: Shell Programming – 001
Tags:
Post Data:2018-04-16 19:23:07

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Log currently running shell processes into a file in every 30 seconds. #Linux/Unix: Shell Programming – 001

#!/bin/sh

#find all currently running shells and create in full listing form for them . Log the data into a file in every 30 secs
# -e means currentl running
# -f means full format output
# sleep takes parameters in seconds

ps -ef | grep shell >> process.log
sleep 30

ps -ef | grep shell >> process.log
sleep 30

ps -ef | grep shell >> process.log
sleep 30 From: http://sitestree.com/?p=12193
Categories:Linux/Unix: Shell Programming – 001
Tags:
Post Data:2018-04-16 19:08:10

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

Another Example of Case and For Loop #Linux/Unix: Shell Programming – 001

Output First

bash-3.2$ ./ksh_case_chart.sh
Enter your Number
9
9 * 1 = 9
9 * 2 = 18
9 * 3 = 27
9 * 4 = 36
9 * 5 = 45
9 * 6 = 54
9 * 7 = 63
9 * 8 = 72
9 * 9 = 81
9 * 10 = 90

—-
???

#!/bin/ksh

#example on how to use case and for loop

multi()
{
#clear
for i in 1 2 3 4 5 6 7 8 9 10
do
echo “$Y * $i = `expr $Y * $i`”
done
}

#take a number from the user ( 1..10)
echo “Enter your Number”
read X

case “$X” in

1)
Y=1
multi
;;

2)
Y=2
multi
;;

3)
Y=3
multi
;;

4)
Y=4
multi
;;

5)
Y=5
multi
;;

6)
Y=6
multi
;;

7)
Y=7
multi
;;

8)
Y=8
multi
;;

9)
Y=9
multi
;;

10)
Y=10
multi
;;

esac
exit

—– From: http://sitestree.com/?p=12189
Categories:Linux/Unix: Shell Programming – 001
Tags:
Post Data:2018-04-16 18:48:57

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada

#Engineering: #Canada: #Job/Contract/Project: Any #Engineering: #Computer, #Electrical, #Electronics, #Civil, #Chemical, #Mechanical, #Naval, #Biomedical, and misc Engineering

Date Posted:2021-07-12 .Apply yourself, or submit others as candidates; Build a recruitment team to submit others as candidates; submit RFP to be considered for projects in future; Try to become a vendor so that you are asked to submit consultants/resources in future. If these work for you. This list is posted in this blog everyday provided there are new projects under the criteria

  1. engines-turbines-components-and-accessories-10008
  2. Provision of Engineering Services for Watermain and Wastewater Main Improvements in The Town Of Oakville, Wards 1, 2, 3 (PR-3314A & PR-3314B)
  3. prefabricated-structures-10022
  4. DNE1 Stimulus Electrical
  5. architect-and-engineering-services-10048
  6. Engineering Services Tender 2021 & QA for Gravel Crushing
  7. Engineering Services for Intersection Improvement Program
  8. Request for Engineering Services for the Rehabilitation of Acton Island Bridge
  9. P8143 IPD Structural Engineer Consultant – Edmonton Public School Board (EPSB) Solar Initiative: Phase 2
  10. Electrical Review & Back-Up Generator Installation
  11. maintenance-repair-modification-rebuilding-and-installation-of-goods-equipment-10054
  12. Electrical Maintenance & Repair Services, Pictou County, N.S.
  13. operation-of-government-owned-facilities-10039
  14. Engineering Services for Intersection Improvement Program
  15. Owner’s Engineering Services for the Bow River Bridge
  16. research-and-development-r-d-10036
  17. Engineering Services for Intersection Improvement Program
  18. special-studies-and-analysis-not-r-d-10047
  19. Digester 4 Condition Assessment and Feasibility Study from the 20-117 Wastewater Engineering Services Pre-Qualification
  20. Keywords Used:engineer,civil,mechanical,electrical,electronics,mechatronics,naval,biomedical,computer engineer,software engineer,civil engineer,biomedical,electrical engineer,electronics engineer,mechanical engineer,metallurgical,chemical engineer,industrial engineer,communications engineer,quality assurance engineer,Aerospace engineer,aeronautical engineer,Engineering manager,Agricultural Engineer,Automotive Engineer,Environmental Engineer,Geological Engineer,Marine Engineer,Petroleum Engineer,Acoustic Engineer,Acoustic Engineer,Aerospace Engineer,Agricultural Engineer,Applied Engineer,Architectural Engineer,Audio Engineer,Automotive Engineer,Biomedical Engineer,Chemical Engineer,Civil Engineer,Computer Engineer,Electrical Engineer,Environmental Engineer,Industrial Engineer,Marine Engineer,Materials Science Engineer,Mechanical Engineer,Mechatronic Engineer,Mining and Geological Engineer,Molecular Engineer,Nanoengineering,Nuclear Engineer,Petroleum Engineer,Software Engineer,Structural Engineer,Telecommunications Engineer,Thermal Engineer,Transport Engineer,Vehicle Engineer,engineering

    #Canada: #IT Jobs:#Consultants, #Contractors, #Analysts, #Engineers, #Developers, #Technology Consultants, #IT-Consultants Opportunities2021-07-12

    Apply yourself, or submit others as a candidate, Build a recruitment team to submit others as a candidate, submit RFP to be considered for projects in future, Try to become a vendor so that you are asked to submit consultants/resources in future

    1. construction-products-10032
    2. Source List (SL) for Environmental Consulting Services
    3. edp-hardware-and-software-10034
    4. Source List (SL) for Environmental Consulting Services
    5. energy-10007
    6. Source List (SL) for Environmental Consulting Services
    7. Prime Consultant for Main Building Foundation Repairs & Site Grading
    8. fire-fighting-security-and-safety-equipment-10010
    9. Source List (SL) for Environmental Consulting Services
    10. machinery-and-tools-10015
    11. Source List (SL) for Environmental Consulting Services
    12. architect-and-engineering-services-10048
    13. REQUEST FOR PROPOSAL (RFP) for PRIME CONSULTANT SERVICES for EVANSBURG – GRAND TRUNK K-12 SCHOOL MODERNIZATION (SOLUTION FOR EVANSBURG AND WILDWOOD) 2021 School Capital Announcement
    14. Consulting Services for Mill Creek Improvements
    15. Consultant Services: Nordel Way Multi-Use Pathway
    16. P8143 IPD Structural Engineer Consultant – Edmonton Public School Board (EPSB) Solar Initiative: Phase 2
    17. communications-photographic-mapping-printing-and-publication-services-10042
    18. PQR for Destination Development, Management Research and Analytic Consulting Services
    19. PQR for Research and Analytic Consulting Services
    20. Incremental Specification and standardization of Maps for the Web (NRCan-5000059855)
    21. environmental-services-10050
    22. Consulting Services for Mill Creek Improvements
    23. G85-405 – ENVIRONMENTAL CONSULTING SERVICES – TRIENNIAL CONTRACT
    24. Source List (SL) for Environmental Consulting Services
    25. financial-and-related-services-10038
    26. RQQ-2020-FACA-499: VOR + 2nd Stage- Provide Accounting & Tax Consulting Services
    27. Request for Proposal (RFP) for Actuarial and Pension Consulting Services
    28. health-and-social-services-10052
    29. Psychology Consulting and Quality Assurance Services
    30. operation-of-government-owned-facilities-10039
    31. P77PB21274 – ATC PROJECT CONTROL CONSULTING SERVICES
    32. professional-administrative-and-management-support-services-10040
    33. RQQ-2020-FACA-499: VOR + 2nd Stage- Provide Accounting & Tax Consulting Services
    34. Downtown Community Safety Action Plan Development Consultant
    35. REQUEST FOR PROPOSAL (RFP) for PRIME CONSULTANT SERVICES for EVANSBURG – GRAND TRUNK K-12 SCHOOL MODERNIZATION (SOLUTION FOR EVANSBURG AND WILDWOOD) 2021 School Capital Announcement
    36. Task Based Professional Services (TSPS) 1.2 Organizational Design and Classification Consultant at the senior level. (2021-ADMHRCIV-0030)
    37. quality-control-testing-inspection-and-technical-representative-services-10053
    38. Source List (SL) for Environmental Consulting Services
    39. Request for Proposal for Consulting Services – Oakmont Trail
    40. research-and-development-r-d-10036
    41. Specialist Environmental Consulting Services
    42. special-studies-and-analysis-not-r-d-10047
    43. Request for Proposal for Consulting Services – Oakmont Trail
    44. undefined-10055
    45. RQQ-2020-FACA-499: VOR + 2nd Stage- Provide Accounting & Tax Consulting Services
    46. EPS/BLRS Web Surveillance Solution for Short-Term Rentals in the City of Ottawa
    47. Source List (SL) for Environmental Consulting Services
    48. #Sensor: #Canada: #Job/Contract/Project: #Sensor, #Tracking, #Fusion, #Estimation, #Surveillance, #sensor network, #target #tracking, #security 2021-07-12

      Date Posted:2021-07-12 .Apply yourself, or submit others as candidates; Build a recruitment team to submit others as candidates; submit RFP to be considered for projects in future; Try to become a vendor so that you are asked to submit consultants/resources in future. If these work for you. This list is posted in this blog everyday provided there are new projects under the criteria

      1. aerospace-10005
      2. Communication Security Equipment (W6399-21CA06/A)
      3. armament-10027
      4. Signal Smoke Marine, Orange (W8486-217390/A)
      5. Communication Security Equipment (W6399-21CA06/A)
      6. communications-detection-and-fibre-optics-10031
      7. ITS Operational Security Services
      8. edp-and-office-equipment-maintenance-10035
      9. Applicant Tracking System
      10. engines-turbines-components-and-accessories-10008
      11. Communication Security Equipment (W6399-21CA06/A)
      12. fire-fighting-security-and-safety-equipment-10010
      13. SURVEILLANCE SYSTEM – Fisher Court – 401 Fourth Avenue W, Geraldton, 401R Fourth Avenue W, Geraldton & Collingwood Court, 610 Winnipeg Street, Schreiber
      14. SURVEILLANCE SYSTEM – 1908, 1930,1940 FREDERICA STREET
      15. Regional headquarters security platform upgrade
      16. RFQ for the Provision of Security Guard Services
      17. marine-10017
      18. Communication Security Equipment (W6399-21CA06/A)
      19. office-stationery-and-supplies-10021
      20. Communication Security Equipment (W6399-21CA06/A)
      21. scientific-instruments-10024
      22. Water Level Sensor Install and Maintenance
      23. information-processing-and-related-telecommunications-services-10049
      24. One (1) Information Technology Security Threat and Risk Assessment and Certification and Accreditation Analyst for the Financial Consumer Agency of Canada (FCAC). (20210477)
      25. maintenance-repair-modification-rebuilding-and-installation-of-goods-equipment-10054
      26. Traffic Signal Rebuild and Illumination upgrades – RR 41 Woodlawn Road at RR 50 Niagara Street, in the in the City of Welland
      27. professional-administrative-and-management-support-services-10040
      28. Content Delivery Network (CDN) Solution c/w Security for CBC/Radio-Canada
      29. research-and-development-r-d-10036
      30. ITS Operational Security Services
      31. special-studies-and-analysis-not-r-d-10047
      32. Water Level Sensor Install and Maintenance
      33. undefined-10055
      34. EPS/BLRS Web Surveillance Solution for Short-Term Rentals in the City of Ottawa
      35. Keywords Used:sensor,fusion,sensor network,tracking,target tracking,surveillance,self driving car,self-driving,estimation,security,signal processing,image processing,autonomouse vehicle,facial recognition,signal,recognition,sensor fusion

        economics Canadian Labor Market Bounces Back Strongly After Lockdowns

        Billion-dollar mistake: How inferior IT killed Target Canada

        https://www.zdnet.com/article/billion-dollar-failures-how-bad-decisions-and-poor-it-killed-target-canada/

        Canadian Labor Market Bounces Back Strongly After Lockdowns
        https://www.bloomberg.com/news/articles/2021-07-09/canadian-labor-market-bounces-back-strongly-after-lockdown

        Example use of case #Linux/Unix: Shell Programming – 001

        Example Output:
        10 * 1 = 10
        10 * 2 = 20
        10 * 3 = 30
        10 * 4 = 40
        10 * 5 = 50
        10 * 6 = 60
        10 * 7 = 70
        10 * 8 = 80
        10 * 9 = 90
        10 * 10 = 100

        ———————————-

        #!/bin/bash
        multi()
        {
        clear
        for ((i=1;i<=10;i++));
        do
        echo “$Y * $i = `expr $Y * $i`”
        done
        }

        echo “Enter your Number”
        read X

        case “$X” in

        1)

        Y=1
        multi
        ;;

        2)

        Y=2
        multi
        ;;

        3)

        Y=3
        multi
        ;;

        4)

        Y=4
        multi
        ;;

        5)

        Y=5
        multi
        ;;

        6)

        Y=6
        multi
        ;;

        7)

        Y=7
        multi
        ;;

        8)

        Y=8
        multi
        ;;

        9)

        Y=9
        multi
        ;;

        10)

        Y=10
        multi
        ;;

        esac
        exit

         


         

        Output

         

        7 * 1 = 7
        7 * 2 = 14
        7 * 3 = 21
        7 * 4 = 28
        7 * 5 = 35
        7 * 6 = 42
        7 * 7 = 49
        7 * 8 = 56
        7 * 9 = 63
        7 * 10 = 70 From: http://sitestree.com/?p=12187
        Categories:Linux/Unix: Shell Programming – 001
        Tags:
        Post Data:2018-04-16 18:33:14

        Shop Online: https://www.ShopForSoul.com/
        (Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
        In Bengali: http://Bangla.SaLearningSchool.com
        http://SitesTree.com
        8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
        Shop Online: https://www.ShopForSoul.com/
        Medium: https://medium.com/@SayedAhmedCanada