Quote:
Originally Posted by wjevans_7d1@yahoo.co
You've explained it quite well!
We won't do the work for you, of course, but here's a good place to raise any specific questions.
My question for you is:
What does your script look like so far?
|
Looks like the below. I researched awk and sed. I'm lost as how to do the "quoted" part with sed.
#!/bin/sh
#
# Filename: super-transfer.sh
#
# ===========================
# mount devices
# ===========================
#
#
mkdir /mnt/abc1/
mkdir /mnt/xyz/
mount /dev/abc1 /mnt/abc1/
mount /dev/xyz /mnt/xyz/
#
# ======================================
# Pull, examine, and create new integer
# * Scripts are located in home directory
# ======================================
# * folder-renaming.x naturally contains a 0; it was a manually created file.
#
awk '{ print expr $1 + 1 > "folder-renaming.x"}' folder-renaming.x
#
#
# ======================================
# Change variable of saving folder
# ======================================
#
#
# I don't have full understanding of sed.
# I was playing with sed, but I can't figure out how to
# assign a variable to something part of the folder-directory system
# Example: /information/$variable/
# I figure I would do something like this:
#
#-----------------------------------------------------------
sed '/$variable/s//$1/g' # I know this isn't right at all
#-----------------------------------------------------------
#
#
# $1 would be from folder-renaming.x
# and $variable would be from the script that saves stuff
#
#________________________________________________________________
Quote:
# This would be that script: (not part of super-transfer.sh)
# Let's call this next, outside script "copystuff.sh"
#________________________________________________________________
#===============================================
##!/bin/sh
##copy stuff to storage medium
#-------------------------------------------------
# mkdir /mnt/abc1/information
# mkdir /mnt/abc1/information/$variable/
# cp /mnt/xyz/folder/ /mnt/abc1/information/$variable/
#-------------------------------------------------
#===============================================
#
# I want $variable to be replaced with the new variable
# that was created inside of folder-renaming.x
# I suppose I would have to use sed, but I wouldn't know how.
# I don't know how to make it handle two files; I only know how to
# make it handle the editing and replacing of one file at the moment.
exit 0
|
#
#________________________________________________________________
#________________________________________________________________
#________________________________________________________________
#
#
We are now looking at super-transfer.sh again
#
#
# ===========================
# delete folder
# ===========================
#
rmdir /mnt/xyz/folder/
#
#
# ===========================
# unmount devices
# ===========================
#
#
umount /dev/abc1 /mnt/abc1/
umount /dev/xyz /mnt/xyz/
#
#
#
exit 0