Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Problem setting path to external hard drive as a variable Post 303030796 by machine_spirit on Saturday 16th of February 2019 12:14:36 AM
Old 02-16-2019
Problem setting path to external hard drive as a variable

Hello all,

I am EXTREMELY new to using bash and I have a bit of a problem: I'm trying to set up a shell script that can
  • 1.) take one of several giant files off of an external hard drive
  • 2.) use it as input for scripts on my laptop's hard drive
  • 3.) send output of those scripts to the external hard drive
  • 4.) delete the giant file off my laptops hard drive
  • 5.) repeat

Everything is set up in a cript i wrote that performs this process using three different folders on my laptop, but when i go to pull files off my external hard drive I find I am unable to do so! I've poked around and tried to find the problem, but as a true novice I'm having no luck. Heres what it looks like:

Code:
#!/bin/sh
prev_dir= /Volumes/My\ Passport/test_reads_folder_a
new_dir=/Users/mylapple/desktop/test_reads_folder_b

cd $prev_dir
for i in `cat targeted_files.txt` 
do
   sed -i '' 's/\r$//' $i 
   echo $i
   cd $prev_dir          
   cp $i $new_dir         
   
done

Gives me the output:
Code:
./4fqmv.sh: line 11: cd:  /Volumes/My Passport/test_reads_folder_a: No such file or directory
cat: targeted_files.txt: No such file or directory

Any suggestions?

Last edited by machine_spirit; 02-16-2019 at 01:17 AM.. Reason: Found a typo
This User Gave Thanks to machine_spirit For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

listing directories of an external hard drive

How do I do it? I have a mac and a pc and am having a time cd-ing to the external drive. (2 Replies)
Discussion started by: theGooch
2 Replies

2. Solaris

FAT32 usb external hard drive - how to mount??

Hello ! What is the comand to mount and usb hard disk ? I have Solaris 10 installed! 10nx! (1 Reply)
Discussion started by: daniel.balasa
1 Replies

3. UNIX for Dummies Questions & Answers

External SCSI hard drive

Someone gave me a small external SCSI hard drive for my SunOS 5.8 test system. How do I make Unix see the hard drive? (2 Replies)
Discussion started by: FredSmith
2 Replies

4. Ubuntu

External Hard drive won't mount

i have a Simple Tech hard drive that i use between two computers. it is formatted to ntfs. i have a dell desktop with Ubuntu 7.10 and Ubuntu 8.04 and Windows XP Home. and i have a laptop with Ubuntu 7.10 and Ubuntu 8.04. the laptop recognizes the hard drive on both 8.04 and 7.10 but my desktop... (9 Replies)
Discussion started by: Texasone
9 Replies

5. HP-UX

Mounting an external parallel hard drive

Can anyone please walk me through how to mount an external parallel (or scsi) hard drive in visualize C3000 machine? I also would like to mount "/var/sallie" directory in that external drive. My "/var/sallie" directory is running out of space so I would like to mount an external hard drive so that... (0 Replies)
Discussion started by: sallysallie
0 Replies

6. Solaris

Connect an External SCSI Hard Drive to Ultra 80

Guys, I have googled and checked this forum in detail and couldn't find any satisfactory answers for my problem. I am trying to connect a external SCSI hard Drive(Sea Gate) to a Ultra 80. I connected it powered it up and at OK prompt did : boot -r system comes up and complains about not... (6 Replies)
Discussion started by: ajnabi
6 Replies

7. Solaris

Boot Solaris off of an old external hard drive

Hi Folks, First a little background, I am working on a ship that operates in the Indian Ocean and Persian/Arabian gulf area. We had a Sunblade 2000 that finally died. The Video board burned up and I guess damaged the mother board. So we ordered 2 rebuilt 2000s one as a spare. Due to mounting... (1 Reply)
Discussion started by: Sean.kelly
1 Replies

8. Ubuntu

How to install Ubuntu11 in external Hard drive

Hi Guys.. I want to install Linux on my portable hard drive. I created a 20GB partition in my hard drive for linux, Now I want to make it bootable mean when I connect it to system n start the system it will start the LINUX and when start without usb-hard drive it should start the windows. ... (3 Replies)
Discussion started by: atul9806
3 Replies

9. Shell Programming and Scripting

I want to copy all files of a said type on my external hard drive

My code is this, what I'm trying to accomplish is to make a list of all pdf documents in my computer and then copy all of those documents to my external hard drive in a directory mkdir /Volumes/Hardrive-1/allpdf echo "File Locations" > /Volumes/Hardrive-1/allpdf/FileLocations.txt mdfind pdf... (2 Replies)
Discussion started by: darpness
2 Replies

10. UNIX for Advanced & Expert Users

External hard drive

I have connected an external hard drive. I can't find it. Both ls /media, fdisk -l and ls /dev show nothing. TIA (3 Replies)
Discussion started by: Meow613
3 Replies
LM-PROFILER.CONF(8)					      System Manager's Manual					       LM-PROFILER.CONF(8)

NAME
/etc/laptop-mode/lm-profiler.conf - Configuration file for lm-profiler, a profiler for laptop-mode-tools. DESCRIPTION
This manual page documents the options that can be set in the /etc/laptop-mode/lm-profiler.conf configuration file. For a description of what lm-profiler does, see the lm-profiler(8) manpage. SETTINGS
The syntax of options is OPTION=value. The following settings are available in lm-profiler.conf: VERBOSE_OUTPUT Set this to 1 if you want to see a lot of output when you run lm-profiler, and 0 if you don't want this. Useful for debugging purposes. (Currently does nothing.) PROFILE_RUN_LENGTH The length of a profiling run, in seconds. This should be a while, so that lm-profiler can gather enough information. The default is 10 minutes (600 seconds). ACTIVITY_INTERVAL_MIN ACTIVITY_INTERVAL_MAX The behaviour that you want to avoid when you have your hard drive spun down, is disk accesses that are spread out over time, because your hard drive will have to spin up for each access. lm-profiler detects when applications perform disk accesses that are at least some time apart (otherwise they can be considered part of the same access) but not TOO far apart (otherwise they are no problem). These settings configure what lm-profiler considers "at least some time apart" and "too far apart", respectively, in seconds. RECOMMEND_DEFAULT_SERVICES DEFAULT_SERVICES If RECOMMEND_DEFAULT_SERVICES is set to 1 (enabled), then lm-profiler will always suggest turning off the services listed in DEFAULT_SERVICES (separated by spaces). IGNORE_PROGRAMS Programs listed in this option, separated by spaces, will be ignored for disk activity profiling. The default settings (which can be referenced as $DEF_IGNORE_PROGRAMS) include common utility programs and all programs used by lm-profiler itself. RECOMMEND_NETWORK_SERVICES When this option is enabled (value 1), lm-profiler will detect any services that are listening on network ports, and it will sug- gest that you disable them. IGNORE_NETWORK_SERVICES Services listed in this configuration option (separated by spaces) are not suggested as a network service by lm-profiler. The default values can be accessed as $DEF_IGNORE_NETWORK_SERVICES. SEE ALSO
lm-profiler(8). laptop_mode(8). laptop-mode.conf(8). AUTHOR
This manual page was written by Bart Samwel (bart@samwel.tk). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation. LM-PROFILER.CONF(8)
All times are GMT -4. The time now is 04:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy