Need Help about dd command new options to put in bash script
i have questions guys about dd command in bash script...
i want to put in bash script about the command dd command and i want to add a new options (-l -u) to put it in my script... -l options to lower case the contents of file -u options to upper case the contents of file... so that whenever i will type in command line dd -u if=file of=file.new OUTPUT of file will become UPPERCASE all... vise versa in -l options... how to this or what to put in bash script... someone please... I greatly appreciate your help... |
Here's a starting point:
http://how-to.wikia.com/wiki/How_to_..._a_bash_script And a follow-up: http://tldp.org/LDP/abs/html/ Cheers, Tink |
Is it my imagination, or is this the same as this thread.
Was duplicated several times, now a duplicated userid maybe ?. |
please help me about these...
|
We did .... the ball is back in your court. Read, learn, ... try stuff.
If you have problems (no, not the kind of where we solve your homework) with execution, or run into errors come back and ask. |
i want to implement in my script the (-u -l) options...
when i try to aliasing it to my .bash_profile it cant what i type like: alias -l='conv=lcase' alias -u='conv=ucase' and i export it... then when i will typed in the command like : dd -l if=file of=file.new and press Enter it says that option -l command not found... so i want to put it in my bash script... but how?... |
I'll just point you back at the first link in my first post in this thread ...
|
You can't add options to existing commands.
The alias command allows you to setup new names for existing commands, and optionally include options after the command name. You can do alias ddl='/bin/dd conv=lcase' and alias ddu='/bin/dd conv=ucase' If you want you can write a script "eg. myveryowndd" and have it parse the command line to take your "-l" option and pass it to dd as "conv=xxxxxx". |
@Prowla
how about if i will pass the options -l and -u ... where i cant start to code these in my script?? ms. prowla??
|
Quote:
Start reading ... https://www.linuxquestions.org/quest...9/#post4617898 I don't know/can't fathom how much time you will waste on asking others to do your work, just follow the first link in the post above; try to understand what they do, and try to transfer it to your own situation. If you have half a brain your goal should be achievable within 10-15 minutes of going there. Cheers, Tink |
Quote:
If you want to write a script, then you could check out getopts for handling command line options in the standard way. What is the background to your question? |
All times are GMT -5. The time now is 02:38 AM. |