简体   繁体   中英

Changing of directories on linux scripts

Can i get some help please, I need to change directories within a script so that different commands can act on the different directories within the script. I currently use Redhat I have tried the following; where xxxx is my current directory ( where the script is location) and new_folder is one of the subfolders I need the script to work on
1. cd “/data/xxxxx/new_folder” 2. cd '/data/xxxxx/new_folder' 3. cd “./new_folder”

Your help is highly appreciated

If using a full path is not an option, try using a path variable to accommodate that info. eg myFolder="/home/users/xxxxx" and then using the variable like this: cd $myFolder/;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM