It is currently Mon, 27 Jun 2022 11:49:34 GMT

Author Message
 Newb request: scripts
Hi. I need 3 scripts that will help me in Linux - wound anyone try to help
me? I know it's
not hard to learn bash, but i'm new and i gave up. They are simple. Maybe
there is something similar to be found on www - I've found many others, but
none of these:

1. Simple thing to move directory with subdirectories/files to new location.
Nice if it returns number of copied (moved) files and megabytes.
2.  Script that lists (ls) current dir with full info (date/size) and
optionally, with arguments:
sorts (by date or size) and number of positions listed (example
 my_list -s -10  that will show 10 full-info files sorted by size)
3. simple alias to replace my cd-rom folder by given name and to change
prompt to /home/user/bin/given_cd_folder_name (if possible - give the cd
name when linux starts)

Thanks Very Much, if anyone helps...

 Sat, 09 Sep 2006 18:24:26 GMT   
 Newb request: scripts

Can you not simply use the mv command?

There are other ways, if not.

Try this with test directories and files until you
understand what is going on. It is quite easy to
overwrite your most precious files if you are careless.

ls. The -t argument will sort by time (date/age). -r will reverse
the order of sorting. To sort by size, you can use -S.

"man ls" for more details.

I do not understand what you want.

Your prompt can be set quite easily. It is the variable PS1 (PS2,
PS3, and PS4 are sub-prompts). So PS1="What now? " will set your
prompt. Some people set their prompts to include the directory they
are in. Others use the classic "$ ". The convention is that root's
prompt is always "# ".

I think your problem is that you have frightened yourself by
trying to write shellscripts. Start with the basic commands.
Generally, these will do what you want. You can use the man
and info commands to see how they work.

Soon, you will want to combine commands, using pipes to
pass the output of one command into another. Then you will
have started writing shellscripts without noticing.


 Sat, 09 Sep 2006 18:52:34 GMT   
 Newb request: scripts
Hash: SHA1

Why? You said it's not hard. Sounds a bit like you would be to
lazy to do any work on your side. But then, this is a newsgroup
not a corporate help-desk, where people get paid to help you.
There are lots of knowledgeable people out here willing to help
you, but you have to do your part first.

Sounds like homework?

Use 'mv' no script needed.

You would need to calculate/store them before moving, since mv
doesn't display even with -v the files moved, only directories on
my box.

There's no script needed, just try 'man ls' for options.

 ls -alS | head -10

Show us what you already have?

- --
Michael Heiming (GPG-Key ID: 0xEDD27B94)

Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of spam.
Version: GnuPG v1.2.4 (GNU/Linux)


 Sat, 09 Sep 2006 19:14:18 GMT   
 Newb request: scripts

You are much more likely to receive a response if you post the code
that you have already written.  Without posting your code people are
likely to assume that this is either a homework assignment or
something else that you didn't spend any time on before asking for
help.  Just a suggestion.


 Tue, 12 Sep 2006 04:39:04 GMT   
 Newb request: scripts

There is a great "Advanced Bash Scripting Guide" avaliable at:

Walt R.

 Tue, 12 Sep 2006 07:50:18 GMT   
   [ 5 post ] 

Similar Threads

1. sh newb: case menus w/scripts

2. Newb Help with a Basic Bash Script...

3. newb Q, script files

4. Request for Help with pap/chap pppd dial-in script

5. shell script to log http request

6. script to relay a web request to another server

7. running script at tcp connection request

8. Issuing http request via bash shell script

9. PPP using kerneld and request-route script.

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software