gptcli
gptcli copied to clipboard
extglob support for gptcli command
The gptcli command uses /bin/sh as the default shell to execute commands. However, when some commands require the use of "extglob" extensions, they cannot be executed. Here's an example.
$ gptcli command "make five 5 folders and 3 files"
❯ mkdir folder1 folder2 folder3 folder4 folder5 && touch file1.txt file2.txt file3.txt
$ ls
file1.txt file2.txt file3.txt folder1 folder2 folder3 folder4 folder5
$ gptcli command "move all folders except folder4 and folder5 to folder5"
❯ mv !(folder4|folder5) folder5
? execute the command above ⬆️ ? Yes
/bin/sh: 1: Syntax error: "(" unexpected
If I enable the shopt -s extglob in bash, and run the same commnad manully, it works fine.
$ mv !(folder4|folder5) folder5
$ ls
folder4 folder5
@huwan Thank you very much for your feedback. I will handle this issue.