.profile


bash script to run lftp with ftp path

点点圈 提交于 2019-12-12 03:32:32
问题 I'm trying to write a bash alias/function that takes an ftp path and runs lftp to pget the file. Given a remote path, with spaces encoded as %20 like: sftp://ftp.example.com/Some%20Folder/BigFile.mov I have this snippet to clean up the %20 and server part of the URL: echo $1 | sed 's/%20/ /g' | sed 's/sftp:\/\/ftp.example.com//g'; which gives me /Some Folder/BigFile.mov Now I need to run this through lftp like this: lftp sftp://ftp.example.com -u user,pass -e "pget -cn10 '/Some Folder/BigFile

creating an alias in ubuntu , in .profile

烈酒焚心 提交于 2019-12-04 15:07:50
I can't figure out why this simple alias isn't work. I've read online an example on creating it and don't know where I'm going wrong... I've added the following to my .profile file at the bottom: alias profile='sudo nano ~/.profile' When I type in 'profile' in the terminal it says command not found... I have a feeling this is a very very simple error I'm making. Thanks everyone! What happens if you log out and back in? Alternatively you could just type source .profile and that should activate your alias. Many people using bash set their aliases up in the .bashrc file. Arvind to add alias

工具导航Map