This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Define default configuration settings | |
Stream="ExtraFormat" | |
# Alert message | |
alert=$(printf "%10s\n""\n Usage: $0 offers the following arguments:\n | |
-i, --ip camera_ip, REQUIRED (string) | |
-u, --username camera_username, REQUIRED (string) | |
-p, --password camera_password, REQUIRED (string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# this is run within the directory from which the script is executed and relies upon the csv file titled 'index.csv' | |
# note in the oldname to newname process, bash on mac introduces /r (carriage return) chacters within the csv, | |
# therefore a step variable is added that overcomes the rename issue | |
while read line | |
do | |
oldName=${line%,*} | |
step=${line#*,} | |
newName=${step%$'\r'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proper_name_formatting <- function(x) { | |
y <- strsplit(x, " ")[[1]] | |
paste(toupper(substring(y, 1,1)), substring(y, 2), | |
sep="", collapse=" ") | |
} | |
# below is an example for how to use the function | |
# usages is sapply(x, proper_name_formatting) | |
# hello_world <- c("hello world) | |
# sapply(hello_world, proper_name_formatting) -> Hello World |