10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I asked this question last month in Stack Exchange (linux - delete directory with leading hyphen - Server Fault) and none of the answers supplied worked.
I have somehow created a directory with a leading hyphen and cannot get rid of it.
# ls -li | grep p
2621441 drwxr-xr-x. 2 root root... (4 Replies)
Discussion started by: edstevens
4 Replies
2. Shell Programming and Scripting
I have a huge text file, about 52 GB. In the file, there are patterns like these:
]
]
]
]One can see that there is text within patterns such as and ], and I am only interested in ]. There is text before and after all these patterns too, for example,
''Anarchism''' is a ] that advocates ]... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies
3. Shell Programming and Scripting
Hey guys,
I have a file that is delimited by | and I am trying to write a sed command to
convert this:
abc|def||ghi|jkl||||mnop
into this:
abc|def|-|ghi|jkl|-|-|-|mnop
The output I am getting out of:
sed -e "s/+//g" /tmp/opt.del > /tmp/opt2.del
is like:
... (9 Replies)
Discussion started by: prohank
9 Replies
4. Shell Programming and Scripting
once again I need a hint how to operate a dot and a hyphen.
my aim is to use
echo $RANDOM$RANDOM$RANDOMgiving me a bunge of numbers. I need to seperate them into yyy.xxx.zzz-tt
sed i\.makes a dot in front of the output. Before that I tried something likejot -r -n 8 0 9 | rs -q 0or even more... (6 Replies)
Discussion started by: 1in10
6 Replies
5. Shell Programming and Scripting
I'm attempting to replace a substring that contains a hyphen and not having much success, can anyone point out where i'm going wrong or suggest an alternative.
# echo /var/lib/libvirt/images/vm888b-clone.qcow | sed -e 's|vm888-clone|qaz|g'
/var/lib/libvirt/images/vm888b-clone.qcow (1 Reply)
Discussion started by: squrcles
1 Replies
6. Shell Programming and Scripting
How do I use awk to replace the first hyphen of a specific record? (1 Reply)
Discussion started by: locoroco
1 Replies
7. UNIX Desktop Questions & Answers
Hi, I'm trying to do something relatively simple.
I have a txt file that has the following kinds of lines (and many more lines):
CP19 Oahu - Maunawili Falls
CP20 Oahu - Maunawili Falls
AG12 Oahu - Maunawili Falls
CP22 Oahu - Maunawili Falls, Local area
AG14 Oahu
CP141 KZ102 Kauai -... (7 Replies)
Discussion started by: euspilapteryx
7 Replies
8. Shell Programming and Scripting
Hi,
I have a trivial question to ask, I am seeing in some shell scripts the '-' (hyphen) character following the first line of shell script (i.e) the shebang notation as follows:
#!/bin/sh -
#! /bin/bash -
what does the hyphen signify? What will happen if it is not given explicitly? (2 Replies)
Discussion started by: royalibrahim
2 Replies
9. Shell Programming and Scripting
I have a text file like this with hundreds of lines:
>cat file1.txt
1027123000
1027124000
1127125000
1128140000
1228143000
>
all lines are very similar and have exactly 10 digits. I want to separate the digits by twodigit and hyphens....like so,
>
10-27-12-30-00
10-27-12-40-00... (7 Replies)
Discussion started by: ajp7701
7 Replies
10. Shell Programming and Scripting
In one script i have seen - in #! line can somebody explain the meaning of -(hyphen) here
#! /bin/sh - (7 Replies)
Discussion started by: Dhruva
7 Replies