Sample Header Ad - 728x90

Test variable if its string or not

0 votes
2 answers
1174 views
I'm writing a script which will have some arguments and so I am using getopts but i want to solve the problem with one argument. I use a switch, for example -d, and I want the argument for -d will be the path to a directory, like ./work. I want to test the user's input for a string or path, not a number. Is there any solution to solve this problem? I want to solve it with something like: If (test) then echo it is string else echo it is not string
Asked by xpukm (13 rep)
Nov 11, 2013, 10:45 PM
Last activity: May 19, 2024, 11:13 AM