Find Jobs
Hire Freelancers

Bash Script

$30-125 USD

処理中
投稿日: 約16年前

$30-125 USD

完了時にお支払い
Write a command called directory which will present a visual representation of the user’s directory structure, starting from their $HOME directory and passing through each directory in the hierarchy.? The screen should be cleared before presenting the output, and the user should be offered the command prompt after the display has been given. The hierarchical level of each directory needs to be represented by the length of an indent string so that the user can immediately see which directories are under which parent directories.? You should also add a number at the end of each directory line.? ? Write additional features into the standard directory program so that after the directory structure has been displayed to the user, the user may jump to a given directory by specifying a given argument. The behaviour of directory should be amended so as to fulfill the following: i) when directory is executed with more than one argument, a non-numeric argument, or a number greater than the highest number in the directory structure output display, correct usage is displayed. ii) when directory is executed with a single argument of 0, the directory structure is displayed. iii) when directory is executed with a number within the range 1-<max-number-from-dir-structure-display> (ie in the example below 1-14), the user is automatically taken to the corresponding directory, the name of which is displayed. Follows is an example of the result of directory 0 being entered at the command prompt. ## Deliverables Using these tools create a bash script to do the following below. ? echo ? if / test ? loops ? clear ? arrays ? functions (esp concept of recursion) ? how the path works ? variable assignment ? let ? directory structures ? ls The directory command Write a command called directory which will present a visual representation of the user’s directory structure, starting from their $HOME directory and passing through each directory in the hierarchy.? The screen should be cleared before presenting the output, and the user should be offered the command prompt after the display has been given. The hierarchical level of each directory needs to be represented by the length of an indent string so that the user can immediately see which directories are under which parent directories.? You should also add a number at the end of each directory line.? See the example below for the presentation of the output: -(0) /home/<user-name>-(1) ..........a-(2) ....................Flat-(3) ..............................Database-(4) ..............................unix-(5) ........................................dir1-(6) ....................taxes-(7) ....................Database-(8) ..............................course-(9) ..............................force-(10) ........................................exercises-(11) ..................................................Compose10-(12) ..................................................Compose11-(13) ..................................................Compose12-(14) The example above shows that directly under the home directory, there is a single directory ‘a’ which contains ‘Flat’, ‘taxes’ and ‘Database’.? Under ‘Flat’ there is ‘Database’ and ‘unix’. Note the ‘empty’ directory above the output with the number 0.? You should place the first element of your list of directories as element 0, and the home directory as element 1. All subsequent directories need to be numbered sequentially, irrespective of their hierarchical placement, as shown above. Configuration Allow the developer to specify which character should be used as an indent marker (in the example above, this is a ‘.’ Character), and how many characters should be used for each indent level; this should be done in a convenient place in the script, so that it can be easily changed. Write additional features into the standard directory program so that after the directory structure has been displayed to the user, the user may jump to a given directory by specifying a given argument. The behaviour of directory should be amended so as to fulfill the following: i) when directory is executed with more than one argument, a non-numeric argument, or a number greater than the highest number in the directory structure output display, correct usage is displayed. ii) when directory is executed with a single argument of 0, the directory structure is displayed. iii) when directory is executed with a number within the range 1-<max-number-from-dir-structure-display> (ie in the example below 1-14), the user is automatically taken to the corresponding directory, the name of which is displayed. Follows is an example of the result of directory 0 being entered at the command prompt. -(0) /home/<user-name>-(1) ..........a-(2) ....................Flat-(3) ..............................Database-(4) ..............................unix-(5) ........................................dir1-(6) ....................taxes-(7)
プロジェクト ID: 3924722

プロジェクトについて

5個の提案
リモートプロジェクト
アクティブ 16年前

お金を稼ぎたいですか?

Freelancerで入札する利点

予算と期間を設定してください
仕事で報酬を得る
提案をご説明ください
登録して仕事に入札するのは無料です
アワード者:
ユーザーアバター
See private message.
$85 USD 2日以内
5.0 (160 レビュー)
6.0
6.0
この仕事に5人のフリーランサーが、平均$85 USDで入札しています
ユーザーアバター
See private message.
$85 USD 2日以内
4.9 (210 レビュー)
6.2
6.2
ユーザーアバター
See private message.
$106.25 USD 2日以内
5.0 (75 レビュー)
4.6
4.6
ユーザーアバター
See private message.
$106.25 USD 2日以内
4.8 (20 レビュー)
4.4
4.4
ユーザーアバター
See private message.
$42.50 USD 2日以内
0.0 (0 レビュー)
0.0
0.0

クライアントについて

UNITED STATESのフラグ
United States
5.0
2
メンバー登録日:5月 10, 2008

クライアント確認

ありがとうございます!無料クレジットを受け取るリンクをメールしました。
メールを送信中に問題が発生しました。もう一度お試しください。
登録ユーザー 投稿された仕事の合計
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
プレビューを読み込み中
位置情報へのアクセスが許可されました。
あなたのログインセッションの有効期限がきれ、ログアウトされました。もう一度ログインしてください。