6

Special characters in command arguments

view full story
linux-howto

http://www.unix.com – Hey Guys, I have a program that populates a database based on input I feed it. so it would look like: cmd arg1 arg2 ... argN Now some of the arguments have special characters in them so I wrote a small script to pull the args and wrap them in quotes ('arg'). The problem is sometimes the characters can be quotes. So for example the text "don't" should become " 'don'\''t' " so I'm trying to write a small script that will read in a file that looks like: cmd1 arg1 arg2 ... argN ... cmdM arg1 arg2 ... argN and for each one wrap the args. So far I have: Code: #!/u (HowTos)