how can i change command "dd" to copyconv
hi to all members in this forums .. Nice to meet you...
i only have a questions about command utility of "dd": for example i will type: pico trial this is my file. and save it and type chmod a+x trial can there be a way that instead of typing: dd if=trial of=trial.copy conv=ucase so that my output in script trial will all become UPPERCASE. And i want to change this "dd" command to "copyconv" just like the functionality of "dd" command also.. and the "conv=ucase" i would like to do the "conv=u" so that the content of my script trial will become UPPERCASE.. sample: copyconv if=trial of=trial.copy conv=ucase OR instead of "conv=ucase" i like the options "-u" for shortcut to uppercase and "-l" for lowercase... sample: copyconv if=trial of=trial.copy -u is this possible please help ... |
You can use alias to get what you want. For instance, you can modify your .bashrc adding a line like
Code:
alias copyconvU="dd conv=ucase" Code:
copyconvU if=infile of=outfile |
where can i see the .bashrc?? and what command will i typed ? to go to .bashrc?
|
Code:
pico ~/.bashrc |
how to add new options in "dd command"
how can i add new options of "dd command"
like: -u to make contents of a file uppercase and -l to make contents of a file lowercase for example: Code:
pico myfile and i want the contents of file goes here... become uppercase when i add options of such as -u Code:
dd -u if=myfile of=myfile How can i do these in shell script help please... |
Member response
Hi,
Welcome to LQ! Quote:
You could setup a .bashrc & .bash_profile for your user; Code:
sample .bash_profile; Code:
sample .bashrc; Look at links 4,5,&6 to help you to understand. Plus look at link #2 Rute for a good tutorial. Just a few links to aid you to gaining some understanding; 1 Linux Documentation Project 2 Rute Tutorial & Exposition 3 Linux Command Guide 4 Bash Beginners Guide 5 Bash Reference Manual 6 Advanced Bash-Scripting Guide 7 Linux Newbie Admin Guide 8 LinuxSelfHelp 9 Utimate Linux Newbie Guide 10 Linux Home Networking 11 Virtualization- Top 10 The above links and others can be found at 'Slackware-Links'. More than just Slackware® links! |
in my .bash_profile
how is it that i cant add the options -l and -u when i type: Code:
it says that -u command not found why is it... in my .bash_profile i typed there alias -u='conv=ucase' and i export it... How is it, it didnt work... ?? what will i typed in .bash_profile so that my -u options will implement |
Bashrc etc
I think you should read 'man dd' and there are a list of commands that change the behavior of dd to suit the user. If dd doesn't understand the command you pass it will fail.
If I helped at all give me a pat on the back |
the same problem , that i had... T_T...
|
You can't use alias for parameters, just for commands. As I pointed out in my previous post, you can use an alias for a command AND one/various paramter/s and then use that alias AND provide more parameters.
|
hmf.. in that case, i will not used anymore my -u options and -l options that i like to invent to have my file contents become uppercase when i only add -u options in
copyconv -u... T_T... i'd just do the copyconvU and it works, but i like some interesting options like what i want to do in my copyconv with the -u options.. is there a way to do this inside of bash script?? |
Member response
Hi,
Look at UNIX: 'The Grymoire - home for UNIX wizards'. A good intro to 'sed': An Introduction and Tutorial by Bruce Barnett Learn to use the tools available to enhance the commands available. "Knowledge is of two kinds. We Know a subject ourselves, or we know where we can find information upon it."- Samuel Johnson “A tool is but the extension of a man's hand and a machine is but a complex tool. He that invents a machine augments the power of man and the well being of mankind.” - Henry Ward Beecher |
All times are GMT -5. The time now is 02:24 AM. |