How can I write an equivalent GNU/Linux command which gives the same output as the script? The input to the command should be the same as the variable var1 in the following script.
#!/bin/python
my_char = { 'a':'b', 'b':'c', 'c':'d'}
var1 = "abc"
var2 = ""
for ch in var1:
if ch in my_char:
var2+=my_char[ch]
else:
var2+=ch
print var2
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.