Move up() to its own function file
This commit is contained in:
		
							parent
							
								
									6184eba778
								
							
						
					
					
						commit
						0c08add311
					
				
					 2 changed files with 16 additions and 21 deletions
				
			
		
							
								
								
									
										15
									
								
								zsh/func/up
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								zsh/func/up
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,15 @@
 | 
			
		|||
#!/usr/bin/zsh
 | 
			
		||||
# Go up $1 directories, where $1 is an integer (saves me from having to type ../
 | 
			
		||||
# ad nauseum)
 | 
			
		||||
# Eryn Wells <eryn@erynwells.me>
 | 
			
		||||
 | 
			
		||||
if [[ -z $1 ]]; then
 | 
			
		||||
    cd ..
 | 
			
		||||
else
 | 
			
		||||
    local updir=''
 | 
			
		||||
    for (( i=0; $i < $1; i++ ))
 | 
			
		||||
    do
 | 
			
		||||
        updir="../$updir"
 | 
			
		||||
    done
 | 
			
		||||
    cd $updir
 | 
			
		||||
fi
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue