Question: After running

> 
> test=$(security 2>&1 >/dev/null find-generic-password -ga test) echo
>  $test
> 
> 
> 

The output is 

> 
> password: "1234"
> 
> 
> 

I would like to remove everything and only leave the actual password, in these case just 

> 
> 1234
> 
> 
> 

Any help?

Answer: 
If the format is always `password: "value"`, you can do this **efficiently** without any external utility using just substring expansion:

```
echo "${test:11:-1}" #output: 1234

```

If you insist on using other utilities:

```
awk -F'"' '{ print $2 }' <<< "$test" #output: 1234
cut -d'"' -f2 <<< "$test" #output: 1234

```

Both commands above will fail if you have a `"` character in your password. Another solution using `sed` working fine with `"` in your password:

```
sed 's/^password: "\(.*\)"$/\1/' <<< "$test" #output: 1234

```
You can solve it by:

command:

```
 echo 'password: "1234"' | awk -F"\"" '{print $2}'

```

output:

```
1234

```