Skip to main content
Code Review

Return to Question

Tweeted twitter.com/StackCodeReview/status/658424121420828672
"Many moons ago" is uncommon terminology. Added console tag.
Source Link
rolfl
  • 98.1k
  • 17
  • 219
  • 419

Many moonsA long time ago I created a script for moving up directories very quickly in the command line using the command up. You can find usage notes here.

It's a very simple script with just 8 lines of source code, as follows:

if [ -z "1ドル" ]; then
 cd ..
else
 for i in `seq 1 1ドル`;
 do
 cd ..
 done
fi

I've never personally had any problems with it since I made it and started using it myself — but are there any accidental or malicious inputs (particularly with the blind injection of 1ドル) that might cause this to do something bad that I'm not aware of?

Given that the up command isn't used for anything in any command line I'm aware of, I'd like to promote more widespread usage of this script file so that people can type up instead of cd .. all the time, saving three keystrokes (or more if they want to move up more directories) for a very common operation.

Many moons ago I created a script for moving up directories very quickly in the command line using the command up. You can find usage notes here.

It's a very simple script with just 8 lines of source code, as follows:

if [ -z "1ドル" ]; then
 cd ..
else
 for i in `seq 1 1ドル`;
 do
 cd ..
 done
fi

I've never personally had any problems with it since I made it and started using it myself — but are there any accidental or malicious inputs (particularly with the blind injection of 1ドル) that might cause this to do something bad that I'm not aware of?

Given that the up command isn't used for anything in any command line I'm aware of, I'd like to promote more widespread usage of this script file so that people can type up instead of cd .. all the time, saving three keystrokes (or more if they want to move up more directories) for a very common operation.

A long time ago I created a script for moving up directories very quickly in the command line using the command up. You can find usage notes here.

It's a very simple script with just 8 lines of source code, as follows:

if [ -z "1ドル" ]; then
 cd ..
else
 for i in `seq 1 1ドル`;
 do
 cd ..
 done
fi

I've never personally had any problems with it since I made it and started using it myself — but are there any accidental or malicious inputs (particularly with the blind injection of 1ドル) that might cause this to do something bad that I'm not aware of?

Given that the up command isn't used for anything in any command line I'm aware of, I'd like to promote more widespread usage of this script file so that people can type up instead of cd .. all the time, saving three keystrokes (or more if they want to move up more directories) for a very common operation.

added 16 characters in body; edited title
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

Are there any gotchas for this "up" "Up" script for moving up directories quickly?

Many moons ago I created a script for moving up directories very quickly in the command line using the command up. You can find usage notes here: https://github.com/joezeng/up/here .

It's a very simple script with just 8 lines of source code, as follows:

if [ -z "1ドル" ]; then
 cd ..
else
 for i in `seq 1 1ドル`;
 do
 cd ..
 done
fi

I've never personally had any problems with it since I made it and started using it myself — but are there any accidental or malicious inputs (particularly with the blind injection of 1ドル) that might cause this to do something bad that I'm not aware of?

Given that the up command isn't used for anything in any command line I'm aware of, I'd like to promote more widespread usage of this script file so that people can type up instead of cd .. all the time, saving three keystrokes (or more if they want to move up more directories) for a very common operation.

Are there any gotchas for this "up" script for moving up directories quickly?

Many moons ago I created a script for moving up directories very quickly in the command line using the command up. You can find usage notes here: https://github.com/joezeng/up/

It's a very simple script with just 8 lines of source code, as follows:

if [ -z "1ドル" ]; then
 cd ..
else
 for i in `seq 1 1ドル`;
 do
 cd ..
 done
fi

I've never personally had any problems with it since I made it and started using it myself — but are there any accidental or malicious inputs (particularly with the blind injection of 1ドル) that might cause this to do something bad that I'm not aware of? Given that the up command isn't used for anything in any command line I'm aware of, I'd like to promote more widespread usage of this script file so that people can type up instead of cd .. all the time, saving three keystrokes (or more if they want to move up more directories) for a very common operation.

"Up" script for moving up directories quickly

Many moons ago I created a script for moving up directories very quickly in the command line using the command up. You can find usage notes here .

It's a very simple script with just 8 lines of source code, as follows:

if [ -z "1ドル" ]; then
 cd ..
else
 for i in `seq 1 1ドル`;
 do
 cd ..
 done
fi

I've never personally had any problems with it since I made it and started using it myself — but are there any accidental or malicious inputs (particularly with the blind injection of 1ドル) that might cause this to do something bad that I'm not aware of?

Given that the up command isn't used for anything in any command line I'm aware of, I'd like to promote more widespread usage of this script file so that people can type up instead of cd .. all the time, saving three keystrokes (or more if they want to move up more directories) for a very common operation.

edited title
Link
Joe Z.
  • 343
  • 1
  • 6

Are there any gotchas for this "up" script for moving up directories quickly?

Source Link
Joe Z.
  • 343
  • 1
  • 6
Loading
lang-bash

AltStyle によって変換されたページ (->オリジナル) /