Bug 503134
| Summary: | guestfish's list splitting does not recognize internal quoting | ||
|---|---|---|---|
| Product: | [Community] Virtualization Tools | Reporter: | Charles Duffy <charles_duffy> |
| Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
| Status: | ASSIGNED --- | QA Contact: | |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | unspecified | CC: | rjones, virt-maint |
| Target Milestone: | --- | Keywords: | Reopened |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2025-10-17 00:09:52 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Charles Duffy
2009-05-29 06:56:28 UTC
The syntax I was thinking of using was: ["foo", "bar"] guestfish doesn't include a real scanner, instead it splits on whitespace. However it checks the first character of each argument and modifies its behaviour accordingly. For example, if the first character is ' or " then instead of blindly splitting, it searchs for the corresponding close-quote. So with the syntax above, if the first character after whitespace was an opening [ then we would parse the rest as comma-separated strings until a matching ] was found. (The alternative would be to use lex and write a real scanner, but we'd need to be careful not to break existing scripts). This cset adds support for 'sh' and 'sh-lines' commands which should alleviate this problem. http://git.et.redhat.com/?p=libguestfs.git;a=commitdiff;h=57d2dfab18ad3d987d9273bb7c1f42e73e0bbcb2 Example usage: ><fs> sh "echo /s*" /sbin /selinux /srv /sys ><fs> sh-lines "ls -1d /s*" /sbin /selinux /srv /sys Believed to be fixed by: http://git.et.redhat.com/?p=libguestfs.git;a=commitdiff;h=22cee80bc2f631703bf417a54ef4e0f0837e921a This product has been discontinued or is no longer tracked in Red Hat Bugzilla. Reopening because Virtualization Tools has not been discontinued. |